How to display a PDF file that is uploaded using the UploadBox control in PDF Viewer?
PDF Viewer
PDF Viewer control supports viewing, reviewing, and printing PDF files in ASP.NET Web Forms applications. The hyperlink and table of contents support provides easy navigation within and outside the PDF files. The form-filling support provides a platform to fill, flatten, save, and print PDF files with AcroForm. PDF files can be reviewed with text markup annotation tools.
Display uploaded PDF file in PDF Viewer
You can display a PDF document that is uploaded using the Syncfusion UploadBox control in PDF viewer using the client side APIs. Refer to the following code sample.
HTML
<div id = "ControlRegion"> <div> <ej:UploadBox ID="Upload1" SaveUrl="saveFiles.ashx" RemoveUrl="removeFiles.ashx" ClientSideOnCancel="OnCancel" MultipleFilesSelection="false" AutoUpload="true" AllowDragAndDrop ="false" AsyncUpload="true" runat="server"></ej:UploadBox> <div class="control"> <ej:pdfviewer id="PdfViewer1" Height="520" Width="100%" ServiceUrl="../api/PdfViewer" PdfService="Local" runat="server"> </ej:pdfviewer> </div> </div> </div>
JavaScript
function OnCancel(args) { var pdfviewer = $("#PdfViewer1").data("ejPdfViewer"); pdfviewer.load(args.fileStatus.name.toString()); }
In the previous sample, ‘ClientSideOnCancel’ is used to get the uploaded file name and load in PDF viewer. You can find the demo of available side events here.
Output
Note:
A new version of Essential Studio for ASP.NET is available. Versions prior to the release of Essential Studio 2014, Volume 2 will now be referred to as a classic versions.The new ASP.NET suite is powered by Essential Studio for JavaScript providing client-side rendering of HTML 5-JavaScript controls, offering better performance, and better support for touch interactivity. The new version includes all the features of the old version, so migration is easy.
The Classic controls can be used in existing projects; however, if you are starting a new project, we recommend using the latest version of Essential Studio for ASP.NET. Although Syncfusion will continue to support all Classic Versions, we are happy to assist you in migrating to the newest edition.
For current customers, you can check out our components from the License and Downloads page. If you are new to Syncfusion, you can try our 30-day free trial to check out our other controls. If you have any queries or require clarifications, please let us know in the comments section below.
You can also contact us through our support forums, Direct-Trac, or feedback portal. We are always happy to assist you!
Modern HTML5 and JavaScript UI Controls Library | Syncfusion
Syncfusion JavaScript UI controls offer more than 80+ cross-platform, responsive, and lightweight JS/HTML5 UI controls for building modern web applications.