The new lazyLoad parameter scrolls through the page before the PDF is generated, so images that load on scroll are included.
Many pages load images only when they scroll into view, with loading="lazy" or a JavaScript loader. A PDF is generated without scrolling, so images further down such a page could be missing or show a placeholder.
Set lazyLoad to true to scroll through the page before the PDF is generated, the way a visitor would. Images and content that load on scroll are loaded, and the page is scrolled back to the top before it is rendered. It came with the upgrade to Chromium 156.
curl --fail --show-error --output page.pdf --request POST \
--url https://api.html2pdf.app/v1/generate \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <your-api-key>' \
--data '{ "html": "https://example.com", "lazyLoad": true }'How it works
loading="lazy" are loaded straight away.Things to know
waitFor: the wait starts after the scroll.See Lazy-loaded images and Parameters in the documentation.