We are using Javascript to obtain the page number information from our Prince-generated PDFs and insert them into a database application, but these values do not correspond to the page labels in the PDF so frontmatter begins on page 1, when the reality is that the book content begins on page 1. We currently have a formula to help fix this issue, but are wondering if there is a way to simply obtain the page labels from the PDF via Javascript and report this directly in a log file.
Forum › How do I...?
Use Javascript to get PDF page labels
I think we would need to add the page labels to the box tree as currently page styling is not accessible to JavaScript. Another possibility might be to use a PDF tool to dump the page labels.
Following up on this topic with a bit of a twist. When a chapter or article PDF ends with a floating object, our current Javascript ignores those items when reporting the lastbox.pageNum back to our database system, so our pagination is inaccurate. Is there an easy way to report the page number of the final floating object in a document using Javascript? I've attached the Javascript we're using to report this content at present. Any advice would be greatly appreciated. Thanks!