|
-
Aug 4th, 2009, 04:02 PM
#1
Thread Starter
Just Married
Sql to Pdf
Hi guys,
I've a Pdf file in Sql column(Image datatype). I want to create a pdf file from this data. I wrote a code that creates pdf but in corrupted format and small sized.
I'm using following code:-
byte[] barrImg = (byte[])cmdSelect.ExecuteScalar();
sFDPdf.Title = "Specify Destination Filename";
sFDPdf.Filter = "txt files (*.txt)|*.txt|All files (*.*)|*.*";
sFDPdf.FilterIndex = 1;
sFDPdf.OverwritePrompt = true;
if (sFDPdf.ShowDialog() != DialogResult.Cancel)
{
Document myDocument = new Document(PageSize.A4.Rotate());
string strfn = Convert.ToString(DateTime.Now.ToFileTime());
FileStream fs1 = new FileStream(sFDPdf.FileName, FileMode.CreateNew);
fs1.Write(barrImg, 0, barrImg.Length);
fs1.Flush();
fs1.Close();
}
Please help me out.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|