Export PDF
Export print-ready documentation pages with the generated Playwright script.
Every generated Foldocs application includes print styles and a Playwright-based PDF script. The export runs against the built site, so it captures the same prerendered content that is deployed.
Build and preview
pnpm build
pnpm previewThe script uses http://localhost:4173 by default. Set
FOLDOCS_PDF_BASE_URL when the preview uses another origin.
Install Chromium
Install the browser once for the current Playwright version:
pnpm exec playwright install chromiumExport the sitemap
With the preview server running, export every route listed in sitemap.xml:
pnpm docs:pdfFiles are written to pdfs/. Change the destination with
FOLDOCS_PDF_OUTPUT=artifacts/docs.
Export selected routes
Pass paths after the command to avoid exporting the entire site:
pnpm docs:pdf /en/docs /en/docs/deploying /en/docs/guidesPrint behavior
The default stylesheet hides the header, sidebars, page actions, pager, footer, feedback controls, and search overlay. Tabs and accordion panels are expanded so their content is present in the PDF.
Continuous integration
Run PDF export after the static build and upload pdfs/ as an artifact. Keep the
preview process private to the CI job; no public deployment is required.
Last updated Aug 2, 2026