We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Load file

Using the sameple provided for the PDF Viewer control, I can load a file by filename at runtime. I need to pass a file id or name as a paramater.  In the Jquery I have the following:

 <script>
        $(document)
            .ready(function() {
                var ejPdfViewer = $("#pdfviewer").data("ejPdfViewer");
                 ejPdfViewer.load(@ViewBag.Url);
            });
    </script>

VieBag.Url has the link, which loads fine but any page past the first will not. The filename is only sent one time during the process. Any help would be greatly appreciated. 

1 Reply

PR Parthipan R Syncfusion Team May 19, 2016 12:45 PM UTC

Hi Kevin, 
Thank you for using Syncfusion products. 
We can load the PDF document in PdfViewer by passing file name as parameter in load method. Please refer the below code snippet. 
$(document) 
       .ready(function () { 
           var fileName = "Barcode.pdf"; 
           var ejPdfViewer = $("#pdfviewer").data("ejPdfViewer"); 
           ejPdfViewer.load(fileName); 
       }); 
We have also provided a sample to illustrate the same. Please find the sample from the following link. 
Note: Please make sure that the PDF document is available in data folder. 
Regards, 
Parthipan 


Loader.
Up arrow icon