I have 2 tables in my form. I am generating PDF file with the help of itextsharp.dll
I want to break the page when 2nd table is started but it can't work right now
I inserted 2 tables in panel & write following code
*******************************************************************************************
Response.AddHeader("content-disposition", "attachment;filename=Report.pdf");
Response.ContentType = "application/pdf";
Response.Cache.SetCacheability(HttpCacheability.NoCache);
System.IO.StringWriter stringWrite = new System.IO.StringWriter();
System.Web.UI.HtmlTextWriter htmlWrite = new HtmlTextWriter(stringWrite);
panelPrint.RenderControl(htmlWrite);
System.IO.StringReader sr = new System.IO.StringReader(stringWrite.ToString());
Document pdfDoc = new Document(PageSize.A4, 10f, 10f, 10f, 7f);
//Document pdfDoc = new Document(
HTMLWorker htmlparser = new HTMLWorker(pdfDoc);
PdfWriter.GetInstance(pdfDoc, Response.OutputStream);
pdfDoc.Open();
htmlparser.Parse(sr);
pdfDoc.Close();
Response.Write(pdfDoc);
Response.End();
Response.ContentType = "application/pdf";
Response.Cache.SetCacheability(HttpCacheability.NoCache);
System.IO.StringWriter stringWrite = new System.IO.StringWriter();
System.Web.UI.HtmlTextWriter htmlWrite = new HtmlTextWriter(stringWrite);
panelPrint.RenderControl(htmlWrite);
System.IO.StringReader sr = new System.IO.StringReader(stringWrite.ToString());
Document pdfDoc = new Document(PageSize.A4, 10f, 10f, 10f, 7f);
//Document pdfDoc = new Document(
HTMLWorker htmlparser = new HTMLWorker(pdfDoc);
PdfWriter.GetInstance(pdfDoc, Response.OutputStream);
pdfDoc.Open();
htmlparser.Parse(sr);
pdfDoc.Close();
Response.Write(pdfDoc);
Response.End();
***********************************************************************************************
So please tell me how to break that page when 2nd table is started?
Satyaprakash SamantarayPosted Jul 4, 2017, 12:36 AM
Satyaprakash SamantarayPosted Jul 4, 2017, 12:36 AM
Satyaprakash SamantarayPosted Jul 4, 2017, 12:30 AM
Ravi SangtaniPosted Jun 7, 2017, 9:33 AM
anushree partaniPosted Jun 7, 2017, 8:39 AM
Jonathan SterlingPosted Jun 19, 2015, 4:26 AM
Alex SmithPosted Apr 28, 2015, 3:03 AM
//create a PDF document and load file
PdfDocument doc = new PdfDocument();
doc.LoadFromFile("sample.pdf");
//insert blank page at the end of the PDF file
doc.Pages.Add();
//insert blank page as the second page
doc.Pages.Insert(1);
After creating the new page, you can then insert 2nd table to this page.
Jack FandoraPosted Apr 2, 2015, 11:04 AM
http://forums.asp.net/t/1428577.aspx?Add+a+new+page+in+iTextSharp