I am able to click on a button on my Web page to create a PDF document; however, the PDF document overides the Web Page. I want to be able to create the PDF docucment on a new page. Does anyone have sample code to do this.
Currently my code looks like this.
Code:
using (MemoryStream ms = new MemoryStream())
{
myDoc.Save(ms, false);
byte[] buffer = new byte[ms.Length];
ms.Seek(0, SeekOrigin.Begin);
ms.Flush();
ms.Read(buffer, 0, (int)ms.Length);
Response.Clear();
Response.ContentType = "application/pdf";
Response.AddHeader("content-length", ms.Length.ToString());
Response.BinaryWrite(ms.ToArray());
Response.Flush();
ms.Close();
}
Thanks,
Mike