How to initialize the PDF viewer inside the dialog box in ASP.NET MVC?
PDF Viewer
The ASP.NET MVC PDF Viewer control supports viewing, reviewing, and printing PDF files in ASP.NET MVC 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.
Open PDF Viewer inside the Dialog box
PDF viewer can be initialized and used inside the Dialog control. Refer to the following code.
HTML
<div> <a href="#myPopupDialog" data-rel="popup" data-position-to="window" data-transition="fade">Open PDF document</a> <div data-role="popup" id="myPopupDialog"> <a href="#" data-rel="back" class="ui-btn ui-corner-all ui-shadow ui-btn ui-icon-delete ui-btn-icon-notext ui-btn-right">Close</a> <div id="pdfviewer" style="min-height:480px"></div> </div> </div>
JavaScript
@(Html.EJ().ScriptManager())
<script type="text/javascript"> $(function () { // Initialize the PDF viewer control $("#pdfviewer").ejPdfViewer({ serviceUrl: "../api/PdfViewer" }); }); </script> <style> #myPopupDialog-popup { width:60% } |
Find the working sample from the following link:
https://www.syncfusion.com/downloads/support/directtrac/general/ze/Sample1522943175
Refer here to explore the rich set of PDF Viewer features.
An online demo link to view PDF documents using Syncfusion PDF Viewer.
Conclusion
I hope you enjoyed learning about how to initialize the PDF viewer inside the dialog box in ASP.NET MVC.
You can refer to our ASP.NET MVC PDF Viewer feature tour page to know about its other groundbreaking feature representations and documentation, and how to quickly get started for configuration specifications. You can also explore our ASP.NET MVC PDF Viewer example to understand how to create and manipulate data.
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!