I am using ABCpdf 9.1 x64.Net with Coldfusion to create PDF based on HTML content. Each PDF has different headers and footers that are generated as HTML with some Coldfusion code. The title is identical for each page, where the footer is slightly different for each page (since it shows the page number). Here is the main part of my code:
theDoc.Get_Rect().Set_String("67 80 573 742");
theContentID = theDoc.AddImageHTML(pdfContent);
while (true) {
if (!theDoc.Chainable(theContentID)) {
break;
}
theDoc.Set_Page(theDoc.AddPage());
theContentID = theDoc.AddImageToChain(theContentID);
}
for (i=1; i <= theDoc.Get_PageCount(); i++) {
theDoc.Set_PageNumber(i);
theDoc.Get_Rect().Set_String("67 755 573 809");
theDoc.AddImageHTML(headerContent);
theDoc.Get_Rect().Set_String("67 0 573 65");
theDoc.AddImageHTML(replace(footerContent, "[page]", i));
}
As you can see, the method AddImageHTML()is called 2 times for each page and once for the content. Therefore, if I have content that creates 6 pages, the method gets 13 times. This is not ideal because the method is time consuming.
HTML? AddImageCopy(), , AddImageHTML().
: getter setter Coldfusion .Net.