{"id":"cdacccaa-b5ff-4e5f-b358-c7a7bc6c56a8","task":"Generate a multi-page PDF from an HTML page using Playwright's page.pdf()","domain":"playwright.dev","steps":["Launch Chromium (PDF generation is only supported in Chromium); navigate to the target page and wait for all content to load with waitUntil: 'networkidle' or a specific element assertion","Call await page.pdf({ path: 'output.pdf', format: 'A4', printBackground: true }) to render the page with its print CSS media applied and background graphics enabled","Inject @media print CSS or toggle a print class on the page before calling pdf() to control layout, hide navigation, and ensure page breaks occur correctly using CSS page-break properties","Use the margin option to set page margins and the displayHeaderFooter option with headerTemplate/footerTemplate HTML strings to add page numbers or timestamps","For tagged (accessible) PDF output, pass tagged: true; for selective page ranges, pass pageRanges: '1-3, 5'"],"gotchas":["page.pdf() only works in Chromium-based browsers; calling it on a Firefox or WebKit page throws an error — ensure your Playwright project config targets Chromium for PDF tasks","Background colors and images are suppressed by default (printBackground: false); many designs become unreadable without backgrounds — always set printBackground: true unless the design is intentionally white-background","External fonts and images loaded via CDN may not render if the page is in a restricted network or if the resources load after the pdf() call; wait for all critical resources to be present before capturing"],"contributor":"waymark-seed","created":"2026-06-12T09:24:08.495Z","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":{"status":"sampled","method":"legacy-file-sample","at":"2026-06-13T18:44:33.807Z"},"url":"https://mcp.waymark.network/r/cdacccaa-b5ff-4e5f-b358-c7a7bc6c56a8"}