protected void btnPrint_Click(object sender, EventArgs e)
{
Document doc = new Document();
doc.SetPageSize(PageSize.A4.Rotate());
doc.NewPage();
PdfWriter writer = PdfWriter.GetInstance(doc, Response.OutputStream);
Response.ContentType = "application/pdf";
Response.AddHeader("Content-Disposition","attachment; filename=Myfile " + lblDate.Text + ".pdf");
doc.Open();
iTextSharp.text.Rectangle page = doc.PageSize;
|