Originally published on eve.gd on 18 October 2021, last updated 6 September 2026.
Read this post on the web (with images, PDF and citation details)
tl;dr: use the node.js module html-pdf-chrome to print programmatically, not Chrome’s built-in virtual-time-budget. See my print.js file for an example.
My CV is generated automatically from Birkbeck’s online repository. It uses a system that basically generates a paginated version of the CV in the browser, using CSS regions technologies, then does a headless print via Chrome. All the source code is available for this.
My CV
the source code is available for this
The problem is that Chrome has an option to wait until the page has fully rendered before printing. If you Google it, you’ll get the answer that you should use the –run-all-compositor-stages-before-draw and –virtual-time-budget=10000 flags.
However, these do not work in the case of my CSS regions work. Regardless of how high I set the virtual time budget, on ultra-fast hardware, Chrome truncated the PDF.
I finally found a new solution in the node.js module html-pdf-chrome. You can see how this is now called inside my print.js file but, essentially, this allows for a timed completion trigger before it sets off the print. Setting this to 5000ms was more than adequate for my purpose.
This reference list has been generated, in many cases, through an automated process and may therefore contain errors or incomplete metadata. It is provided purely as assistance for finding the items mentioned within this post.
1. ‘GitHub - MartinPaulEve/cv’, GitHub <https://github.com/MartinPaulEve/eprintsToCV>
2. html-pdf-chrome npm package <https://www.npmjs.com/package/html-pdf-chrome>
https://github.com/MartinPaulEve/eprintsToCV
https://www.npmjs.com/package/html-pdf-chrome