Footer of my pdf pages
Hi, i'm working on create invoice pdf with jsreport studio. I made a lot of things, but i need the last one: the footer of all pdf pages with information like invoice number, current page/pages, and a counter for every document in the pdf.
How can i do this? How can i print these information always in the footer of the pages?
hi! assuming that you have already the invoice number and document count in your data input you can try something like this using the phantom's footer property of template
mmmm ok but there is a problem. My job is to provide a template that converts an xml with one or more invoices in pdf using jsreport. So if my data is composed of more than one invoices, how can i bind the right page with the right document number? In the body template i use
I do not know if it is clear.
i was a bit sure that your values were actually dynamic and not something static 😀.. in that case you can't use the header and footer feature of phantom-pdf recipe, because these kind of content is not rendered as part of your main template. header and footer are like tiny templates that are just rendered as standalone before and after a new page is being printed, without having access or context about other code evaluated in your main template (like your
i know this is a bit hard to do it but it is only because the current limitations of phantomjs header and footers. hopefully you can make it work.
Well it is really hard to do. I'll try. Does this works with electron-pdf recipe?
electron-pdfdoes not have support for headers and footers (a limitation of electron engine), but you can apply the same technique described previously
ok i'll try what you say previously. Thanks a lot
EDIT: I don't know why but now it works.
be aware that probably for electron recipe you would need to change some part of the script, specifically this part:
// fix phantomjs incorect calculation of page margin // 31 again magical number waterMarkTop += i * 31
I've done it right. Thanks a lot for help me.