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.