How to create a PDF file from a BLOB

T

tofu.captain

I have PDFs saved in a SQL 2005 server as BLOBs. I would like to
extract the BLOBs and either:

1. create a PDF file on the hard disk
or
2. open/stream the PDF into the application

I am using a VB.net winform (not a web form).

How would I go about doing this? I use CutePDF to initially convert a
PDF file and store it into the SQL server, but I must purge the PDF
file from the system.
 
T

Tim_Mac

hi
first thing to do is get your binary info from the database.
then you have the following options for sending a file to a browser:

Response.BinaryWrite (write binary info to browser)
Response.WriteFile (write a file to browser with all-at-once server
memory)
Response.TransmitFile (write a file to browser without using server
memory)

make sure to set the content type as application/pdf. e.g.:
Response.ContentType = "application/pdf";
Response.AddHeader("Content-Disposition",
"attachment;filename=\"Whatever.pdf\"");


hope this helps
tim
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,576
Members
45,054
Latest member
LucyCarper

Latest Threads

Top