Forum How do I...?

Page numbers: PDF content, metadata out of sync

commonsguy
I am generating a book using PrinceXML, and it is generally working very well.

I have set up my CSS to have my front matter (ToC, preface) using lower-roman page numbers, resetting to page 1 and switching to arabic numerals for the first chapter. This is showing up fine in the actual PDF content. However, the PDF metadata (and my apologies if "metadata" is the incorrect term here) is not affected by any of this.

Hence, what is displayed in the content as page iii is known to the PDF viewer as page 3. What is displayed in the content as page xxxii -- the last of my front matter -- is known as page 32 to the PDF viewer. Page 1 -- the first page in the body -- is known to the PDF viewer as page 33. And so on.

I know that I can always fix this up manually using Acrobat Pro by renumbering the pages. However, is there something that I am missing in the CSS or way that I am executing PrinceXML that is causing the page numbers to only affect the PDF content and not the metadata?

Thanks!
jim_albright
counter-reset: page 1

Look at the documentation for Prince. http://www.princexml.com/doc/8.1/page-numbers/

Jim Albright
Wycliffe Bible Translators

commonsguy
counter-reset: page 1;
does not affect the metadata. I already have that in my CSS, and it is resetting what is shown inline in the PDF, but it is not affecting the metadata.
mikeday
You can control the PDF page label using the prince-pdf-page-label property.
commonsguy
OK, that worked. I have:

@page { prince-pdf-page-label: counter(page, lower-roman); }


and:

@page chapter { prince-pdf-page-label: counter(page, decimal); }


and I am getting the results I want out of PrinceXML.

Many thanks!