Click here to Skip to main content
14,449,338 members
Rate this:
Please Sign up or sign in to vote.
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();


So please tell me how to break that page when 2nd table is started?
Posted
Updated 20-Dec-14 1:15am
v2
Comments
Member 14192879 1-Nov-19 20:52pm
   
did you find the solution of this problem?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100