Forum How do I...?

Multiple Inputs, Multiple Page Numbering

dhollenbeck
I am trying to get PrinceXML to output a single PDF using multiple input HTML files. I would like each input to have it's own page numbering system consisting of 'Page x of y`. Getting `x` is of input HTML file is easy. Getting `y` (the total number of pages in just that specific input HTML file) eludes my technical abilities.

Any help to accomplish this with PrinceXML would very much appreciated.

The obvious solution would be to use PrinceXML to render these input HTML files separately and then merge the output PDF's into a single PDF. However, I am looking for a PrinceXML solution to this problem.
mikeday
One way is to link to an element at the end of the HTML file and use target-counter() in the CSS to retrieve the page number that it occurs on, which will be the last page of that file.
dhollenbeck
Thank you for your suggestion. Unfortunately, I am unable to get this working or perhaps understand what I need to code. I have attached my input HTML file. Any help would be greatly appreciated.
  1. input.html1.7 kB
mikeday
I have made some minor adjustments, see attached.
  1. input.html1.7 kB