Menu

Printing 72 vector PDFs from HTML and CSS with headless Chrome
📰

Printing 72 vector PDFs from HTML and CSS with headless Chrome

DEV Community: node·Alan·about 14 hours ago
#TCWdT07v
#devtonodejs#devto#dev#sheet#chrome
Reading 0:00
15s threshold

A blank weekly planner has to be one page on US Letter (8.5×11 in) and on A4 (210×297 mm). A4 is narrower and taller, so a layout tuned for one sheet can spill onto a second page or leave a gap on the other.

MakeInfographics.ai offers its templates as free printable PDFs. There are 12 layouts, each in 3 color themes and 2 paper sizes, which makes 72 files. They come from a small Node script that writes HTML and asks Chrome to print it. The project has no PDF library: none in dependencies or devDependencies , and the script imports only Node built-ins and its own modules.

This post covers how the script is organized, how one layout fits both papers, and what its one-page check does and does not catch.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.