Link to home
Start Free TrialLog in
Avatar of developer2012
developer2012

asked on

how to read binary image from database and display it as PDF file?

Hi Everyone,

I have a requirement in which the pdf file are stored as binary image.   When the user click on view I am required to display the PDF file.

How can I convert a binaryi mage  into PDF file?

It is WPf browser application and it does not have htttp.context method?

Any ideas or help or example are much appreciated and thank you very much!
Avatar of David Johnson, CD
David Johnson, CD
Flag of Canada image

Response.ContentType = "application/pdf"
      Response.BinaryWrite(your-byte-array-name-here)

http://forums.asp.net/t/1060151.aspx/1
Avatar of developer2012
developer2012

ASKER

Thanks. But it is not a asp.net application
>How can I convert a binaryi mage  into PDF file?

If by binary image you mean byte array, write it to a file and then use Process.start to open it

IO.File.WriteAllBytes("path", bytearray)
ASKER CERTIFIED SOLUTION
Avatar of David Johnson, CD
David Johnson, CD
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
@ code cruiser . Yes it is bytearray. How do I write to a file?

Can you please give me an example?

Thanks
I gave you an example: http:#a38422931