Articles in this section
Category / Section

How to read the PDF document from the remote URL and display it in WPF PDFViewer control?

1 min read

You can access the PDF document from Remote URL as stream using WebClient and then display the same in WPF PDFViewer control.

C#

WebClient client = new WebClient();
byte[] myDataBuffer = client.DownloadData((new Uri("<<<<<PDF Document Link>>>>>")));
 
MemoryStream storeStream = new MemoryStream();
storeStream.SetLength(myDataBuffer.Length);
storeStream.Write(myDataBuffer, 0, (int)storeStream.Length);
pdfViewer.Load(storeStream);
storeStream.Flush();

View sample in GitHub.

 

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