How do I open a remote PDF file (using URL)?

Q:
How do I open a remote PDF file (using URL)?

The following code throws an exception:

PDFNet.Initialize();
PDFDoc pdfdoc = new PDFDoc("http://www.pdftron.com/my.pdf");
-----

A:
You are attempting to open a remote document (i.e. a URL) to PDFDoc
constructor, but PDFDoc cinstrucotr currently (i.e. v.3.6) accepts a
file path (not a URI).

If you would like to open remote PDF Documents you can use
standard .NET Framework API (or some other API is you are developing
in C++) to fetch the file.

You can either download file locally:

WebClient client = new WebClient ();
client.DownloadFile("http://www.pdftron.com/my.pdf", my_temp_path +
"my.pdf");

More commonly, you will want to read remote file in memory (i.e.
without saving the file to disk). In this case, you use the OpenRead
() method, Which returns a stream reference. You can then simply
retrieve the data from the stream.

WebClient Client = new WebClient ();
Stream strm = Client.OpenRead ("http://www.pdftron.com/my.pdf");
...
Read stream data to 'data' buffer...
byte [] data = ...;

// Then open the buffer containing PDF document as
// illustrated in PDFDocMemoryTest:
// http://www.pdftron.com/net/samplecode.html#PDFDocMemory

PDFDoc doc = new PDFDoc(data, data.Length);
doc.InitSecurityHnadler(); ....
---------

'System.Net.WebClient' class (from .NET framework) is a very high-
level and simple to use. There are many other (and more powerful) ways
to accomplish the same thing. This should be documented on MSDN or
other .NET developer sites.