Forum How do I...?

How getting a page count multiple of 4?

vbdx
Hi, I need to produce PDFs with a number of pages that is strictly a multiple of 4 (4, 8, 12, etc.) and I wonder if there is an automatic solution for that.

For example, is that possible to generate extra blank pages (just before the back cover) and ask Prince to delete dynamically some of them once the total page count is known?

Many thanks,
- Vincent
mikeday
You would need to run Prince twice and log the page count the first time, then apply CSS to add extra pages the second time.
goldjam
If anyone comes to this page from Google (as I did) with the same problem, we have implemented a solution in Node.js, details are in this post:

https://www.princexml.com/forum/topic/3852/running-two-pass-in-node-wrapper