I am trying to add a new page to a document and can't seem to find where to do that. I need to do this on the fly and can't find the right method to call. Look for all the "?" below. This is just the part where the loop is and I need to check for the number of rows and then create another page. The number of rows is never constant from one document to the next.
EX:
while (intCount != 0)
{
pdfPage.Elements.Add(new ceTe.DynamicPDF.PageElements.Label(myDataSet.Tables[1].DefaultView[intRowCounter].Row["AGENT_ID"].ToString() + "\r\n", 5, floatYCount, 216, 59, ceTe.DynamicPDF.Font.TimesRoman, 10));
pdfPage.Elements.Add(new ceTe.DynamicPDF.PageElements.Label(myDataSet.Tables[1].DefaultView[intRowCounter].Row["NAME"].ToString() + "\r\n", 150, floatYCount, 396, 47, ceTe.DynamicPDF.Font.TimesRoman, 10));
pdfPage.Elements.Add(new ceTe.DynamicPDF.PageElements.Label(myDataSet.Tables[1].DefaultView[intRowCounter].Row["LOA"].ToString() + "\r\n", 400, floatYCount, 108, 13, ceTe.DynamicPDF.Font.TimesRoman, 10));
intRowCounter += 1;
floatYCount += 15;
intCount -= 1;
if (intRowCounter == 30)
{
??????????????????????????? pdfDoc.Pages???????
}
}
pdfDoc.DrawToWeb(this, "AgentReport.pdf");
Response.End();
Adding a new page
Re: Adding a new page
Support · Dec 27, 2006Hello,
You can use the Add method of the Page object to add new pages. Following is the line of code that will allow you to add new pages:
pdfDoc.Pages.Add(new Page());
Thanks,
ceTe Software Support Team
Re: Adding a new page
Forum member · Dec 27, 2006I tried that already. It just adds a new blank page and my other code doesn't add the elements to the new page.
Re: Adding a new page
Forum member · Dec 27, 2006Never mind I figured it out.
I had to do this: pdfDoc.Pages.Add(pdfPage = new Page());