AcroPDFLib to open PDF file from stream in WindowsForms C# .NET

I've spent the whole afternoon looking for an answer to my question and found none :(

I'm making a windows forms application and one of it's features is to show files stored in a DB. This files, upon upload, can be marked as "read-only", meaning they cannot be downloaded. At this point, I'm struggling with PDF files. I'm using the AcroPDFLib and I can't find a way to display the file from the byte array stored in the DB.

So, my question is, is there a way to open a PDF file from a stream? Even if it's a plugin, what plugin is that and where can I find it?

Using the web browser object, I don't think it will work since I would have to create something server-side that sends to the response output the stream. And creating the file in a temporary folder... well, in that case I might as well allow the file download :D

Thanks for your help

Answers


In order to do what you want, you need to open the file from a memory stream, however from the Interapplication Communication API reference from Adobe we get that there is only one Open(...) method:

Syntax: VARIANT_BOOL Open(BSTR szFullPath, BSTR szTempTitle);

Parameters:

szFullPath The full path of the file to open.

szTempTitle An optional title for the window in which the file is opened. If szTempTitle is NULL or the empty string, it is ignored. Otherwise, szTempTitle is used as the window title.

So I would guess that what you are trying to do cannot be done with Adobe's library.


Need Your Help

Calculating total time left and total time from a background worker OnProgressChanged event

c# winforms datetime date-arithmetic

I have a background worker reporting the progress of the computation. It returns the current line number it is processing in the ProgressChangedEventArgs. I can from there determine the percentage ...

Create a marker with gradient fill instead of normal color - Google Maps

javascript css3 google-maps

I am trying to get a dot like marker for Google Maps using google.maps.SymbolPath.CIRCLE - in which I am successful.