I recently downloaded an evaluation of PDFNet Mobile SDK for WinRT platform. I
have a question about opening the PDF file. I looked at the Getting started
tutorial which shows opening a PDF file from the file system. Can I open a PDF
directly from the Http response? I got a exception about missing
This is what I would like to do :
Send a Http request to get PDF document.
Once the response is received ( I would prefer
not to save the response to local disk to create PDF file)
InMemoryRandomAccessStream rs = new
DataWriter writer = new
PDFDoc doc = new PDFDoc(rs);
Can I display the pdf document without saving
the Http response to file system?
I’d like the feature to draw on the PDF document. How to achieve that? Is it by
We do have a constructor that takes a stream as an argument. In fact, our PDFViewCtrl demo opens documents by creating a stream from a StorageFile and passing that to the constructor of PDFDoc.
PDFViewCtrl also supports incremental & on-demand loading of remote PDF documents via OpenURLAsync()
. This means that you do not need to download the entire file before seeing the content. Similar to movie streaming you can see the first page without any delays. You can also jump to any page and PDFNet will download data for the visible pages. For this to work the remote PDF needs to be linearized (see What is a linearized PDF file?
Please note that direct viewing of PDF files via HTTP response is not technically feasible (or at least you may run into very strange results).
As for drawing on the document, we have a tools library that does just that. The PDFViewCtrlDemo in the samples solution uses this library. As you suggested, the are using annotations to do this.
The source code for these tools is shipped to licensed customers, which means that you will be able to modify the tools to suit your app better.