Document pdfDoc = new Document(); pdfDoc.SetPageSize(PageSize.A4.Rotate()); string filepath = "Demo" + ".pdf"; string attachment = "attachment; filename=" + filepath; Response.Charset = String.Empty; Response.ClearContent(); Response.AddHeader("content-disposition", attachment); Response.ContentType = "application/PDF"; PdfWriter.GetInstance(pdfDoc, Response.OutputStream); pdfDoc.Open(); //Adding some paragraph in to the pdfdoc. pdfDoc.Close(); Response.Write(pdfDoc); Response.End();
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)