As you can see in this article
, there are two different constructors that allow you to create PdfDocumentSource
. When you want to use the one with the Uri, you must be sure that you can obtain a Stream that supports both Read and Seek operations from the Uri.
If that is not the case, you can use the constructor that takes a Stream parameter. For example, you can pass a stream to your file and wrap it in a MemoryStream if it does not support Read and Seek operations.
Note that when you use the second approach, you may want to close the stream after the document is loaded. In order to do this, you can attach to the Loaded event of the PdfDocumentSource
where you can safely close the stream.
I hope this helps.
the Telerik team