Hi,
Was wondering whether anyone could help me solve a small issue I am having. The software I am writing uses prince to generate pdfs of invoices. A requirement for the invoice is to have the registered company address and vat number on the invoice, this is usually placed in a footer. Occasionally invoices will be too big to fit on a single page and will break onto a second which is fine, but in this case the registered company address that appears in the footer needs to appear in the footer of both pages.
I achieved this without problem using:
Now the issue I am having is that I must generate this footer text dynamically, which itself is not a problem - however the text is only appearing on the last page and not all pages. I am using the following code to pull the text from the html document and pass it to css content property:
Would this issue occur if the element from which I am pulling the content from over spills itself onto the second page? So when it comes to generating the first page of the PDF, the element is somehow not there on that page from which to pull the content? Any ideas how to get around this problem?
Was wondering whether anyone could help me solve a small issue I am having. The software I am writing uses prince to generate pdfs of invoices. A requirement for the invoice is to have the registered company address and vat number on the invoice, this is usually placed in a footer. Occasionally invoices will be too big to fit on a single page and will break onto a second which is fine, but in this case the registered company address that appears in the footer needs to appear in the footer of both pages.
I achieved this without problem using:
@page { @bottom-center { content: 'Footer Text Here';}
Now the issue I am having is that I must generate this footer text dynamically, which itself is not a problem - however the text is only appearing on the last page and not all pages. I am using the following code to pull the text from the html document and pass it to css content property:
@media print {
.cb-registered-office {
string-set: company_reg contents; /* Get the contents from the footer and save them to string company_ref */
position: absolute;
visibility: hidden; /* Hide the footer so it doesn't appear in the pdf */
}
@page {
margin: 0.5cm 1cm 2.5cm 1cm;
size: A4 portrait;
@bottom-center {
content: string(company_reg); /* Load contents for company_reg into the page footer */
font-size: 7pt;
}
}
}
Would this issue occur if the element from which I am pulling the content from over spills itself onto the second page? So when it comes to generating the first page of the PDF, the element is somehow not there on that page from which to pull the content? Any ideas how to get around this problem?