Articles in this section
Category / Section

How to initialize the PDF viewer inside the dialog box

1 min read

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.

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please sign in to leave a comment
Access denied
Access denied