Articles in this section
Category / Section

How to load the document in PdfViewerControl from URI?

1 min read

PdfViewerControl does not support directly loading a PDF document from URI. However, you can load a PDF document by converting the URI to ByteArray in the sample level.
Refer to the following code snippet.

byte[] pdfDoc = null;
var wc = new System.Net.WebClient();
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
Uri uri = new Uri("http://www.syncfusion.com/downloads/support/directtrac/general/pd/Barcode-1668568277");
//Converts the URI to byte array
pdfDoc = wc.DownloadData(uri);
PdfLoadedDocument doc = new PdfLoadedDocument(pdfDoc);
//Loads the byte array in PdfViewerControl
pdfViewerControl1.Load(doc);

Sample link:
https://www.syncfusion.com/downloads/support/directtrac/general/ze/SampleWF415515807

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