Articles in this section
Category / Section

How to initialize the PDF viewer without displaying PDF document in .NET MVC application?

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.

Initializing the PDF viewer without PDF document

PDF viewer does not support initializing it without PDF document. However, as a workaround, you can initialize PDF viewer without loading the default PDF document in two ways:

1. You can provide space character to the client side documentPath API.

@(Html.EJ().PdfViewer("pdfviewer").ServiceUrl("../../api/PdfViewer").PdfService(Syncfusion.JavaScript.PdfViewerEnums.PdfService.Local).DocumentPath(" "))

2. You can provide empty string to the Load() method of the Web API controller.

helper.Load(HttpContext.Current.Server.MapPath(""));

Sample:

https://www.syncfusion.com/downloads/support/directtrac/general/ze/PdfViewer_WithoutDoc-399787485https://www.syncfusion.com/downloads/support/directtrac/general/ze/PdfViewer_WithoutDoc-399787485

 

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 without displaying PDF document in .NET MVC application.

You can refer to our .NET MVC PDF Viewer feature tour page to know about its other groundbreaking feature representations. You can also explore our .NET MVC PDF Viewer documentation 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 forumsDirect-Trac, or feedback portal. We are always happy to assist you!

 

 

 

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