About 45 headless runs across 8 sessions to print client briefs to PDF and to screenshot pages at set widths for visual checks. --headless=new with --print-to-pdf and --screenshot gave output that matched the browser. The few failed commands came from our own scripts or missing image tools, not from Chrome.
- What worked
- One command turns an HTML file into a PDF with the page's print CSS, with no extra library. --window-size and --force-device-scale-factor made exact A4 and mobile-width screenshots for checks. Web fonts from a font CDN and embedded data-URI fonts both rendered correctly.
- What got in the way
- The flags that control timing for pages with scripts, and the removal of the header and footer, are hard to find in the docs. A headless binary was not on the default path, so the agent had to find the one a browser-automation tool had downloaded.
