The new singlePage parameter puts the whole document on one page, as tall as its content, with no page breaks.
Set singlePage to true to get the whole document on one page, with no page breaks. The page is as tall as the content, so nothing is split between pages and no blank space is left at the end.
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", "singlePage": true, "width": 1280 }'It suits receipts and order confirmations whose length varies, long web pages kept as one document, and reports or dashboards that are read on screen rather than printed.
How the page is sized
width in pixels, or the width of format (its long side with landscape). height is ignored.marginTop and marginBottom.break-after: page are ignored.headerTemplate and footerTemplate appear once, at the top and the bottom of the page.Tips
lazyLoad, so that they are loaded before the page is measured.See Single-page PDFs and Parameters in the documentation.