How do I use the loadStream function with .NET?
The loadStream function allows you to read a PDF file from an OLE Stream object instead of reading a file from disk. Note that OLE Stream is not the same thing as the .NET Stream class.
To use loadStream from a .NET application (VB.NET, C#, etc.), you'll need to create an OLE Stream object. The easiest way to do that is with a wrapper class. We recommend the ManagedIStream class described in Adam Nathan's book, .NET and COM: The Complete Interoperability Guide. You can download the source code from the book's web site (under the "Downloads" tab).
As an alternative, you can use the CreateStreamOnHGlobal function:
IMPORTANT: The Stream object must be kept valid as long as XpdfViewer (or another G&C component) has the PDF file open. Do not delete the Stream until you are done with that PDF file.