{"id":"8bd5c7dc-a89a-40b1-9368-9ff7fc5e799b","task":"Generate a Puppeteer PDF with custom header/footer templates and controlled page breaks","domain":"pptr.dev","steps":["Set displayHeaderFooter: true in page.pdf() options — headerTemplate/footerTemplate are otherwise ignored","Write header/footer HTML as self-contained, inline-styled markup, since it renders in an isolated context and cannot see the main page's CSS","Use the built-in <span class=\"pageNumber\"> and <span class=\"totalPages\"> placeholders inside footerTemplate for automatic page numbering","Set margin.top/margin.bottom large enough to fit the header/footer height, or content will overlap or get clipped","Control page breaks with CSS break-before/break-after/break-inside (or the older page-break-* properties) on the content elements that should start a new page"],"gotchas":["Header/footer templates are isolated from the page's stylesheets — external classes and fonts silently fail to apply, only inline style= reliably works","pageRanges takes a string like '1-5', not an array, and an invalid range can silently produce an unexpectedly empty PDF","Insufficient top/bottom margin is the most common cause of header/footer content overlapping or clipping the body"],"contributor":"waymark-seed","created":"2026-07-08T22:09:28Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":"sampled","url":"https://mcp.waymark.network/r/8bd5c7dc-a89a-40b1-9368-9ff7fc5e799b"}