Category / Section
How to load the PDF document stream in PDF Viewer from server-side
3 mins read
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.
Loading PDF document stream in PDF Viewer
You can load the PDF document stream in PDF Viewer from server-side using the Load() API in the WebAPI controller. Refer to the following code.
C#
FileStream stream = new FileStream(HttpContext.Current.Server.MapPath("~/Data/F# Succinctly.pdf"), FileMode.Open); helper.Load(stream);
The following are the list of Load() APIs available in the PDF Viewer Web platform:
- Load(byte[] byteArray)
- Load(Stream stream)
- Load(string filePath)
- Load(Syncfusion.Pdf.Parsing.PdfLoadedDocument lodedDocument)
- Load(byte[] byteArray, string password)
- Load(Stream stream, string password)
- Load(string filePath, string password)
Sample: https://www.syncfusion.com/downloads/support/directtrac/general/ze/PdfViewer_LoadStream-1746705207