Pdf coming from SQL display in windows form

  • Thread starter Thread starter HenryD
  • Start date Start date
H

HenryD

Hi, I am pulling PDF files from an IMAGE field in SQL2000. I was
wonder what the best way is to display it in a windows form. I was
thinking that I have to save it to the local as a PDF then browse to
it using the AxWebBrowser control. But I would like to avoid that if
possible. Any pointers would be appreciated.

Thanks
 
Hi Henry,

Thanks for your post!
From your description, my understanding now is you want to show an PDF
content
without first saving it as a local file. Please correct me if I didn't
grasp your meaning,
I took a look at the Acrobat Reader control , it only has a LoadFile method
and a src property, which only accept a file name. Since I'm not a
specialist on Acrobat Reader, I don't know if the Acrobat Reader Control
has the ability to load PDF from stream. I recommend you also post this
issue in the Acrobat Community or contact their Technical Support.

From the WinForm side, You may try writing a wrapper class by deriving the
AxPdf class,
and provide a new method which accepts a stream parameter, then internally
you may save the stream to a temporary file then call LoadFile to let
Acrobat Reader control load it, we need manage a opened file list, since I
didn't find an event like OnClosed in this control, so it seems unable to
delete a file right after it is unloaded from the reader. When disposing
this control you can delete these files in the list. This work around
encapsulates the the temporary file handling which maybe make the control
easier to use, however it can't avoid creating a temporary file.

Hope it helpful,thanks!

Best regards,

Ying-Shen Yu [MSFT]
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security

This posting is provided "AS IS" with no warranties and confers no rights.
This mail should not be replied directly, "online" should be removed before
sending.
 
Back
Top