Playwright PDF 导出自动化
Automates headless PDF generation from web pages using the Playwright chromium.launch() API with custom page.pdf() options. Supports A4/Letter sizing, header/footer templates, and configurable margins via Playwright's PDFOptions interface.
Installation
Use the upstream install or setup path that matches your environment:
- npm install -g @playwright/cli@latest
- npm i playwright
Requirements and caveats from upstream:
- Playwright is also available for Python, .NET, and Java.
Basic usage or getting-started notes:
- bash
- Optionally install skills for richer agent integration:
- playwright-cli install --skills
- Source: https://github.com/1991513ccie-png/skills
- Extracted from upstream docs: https://raw.githubusercontent.com/microsoft/playwright/HEAD/README.md