- Home
- Skills
- APIs & Backend
- HTML to PDF (High-Fidelity)
Works with the AI Agents you already use
HTML to PDF (High-Fidelity)
Convert local HTML to high-fidelity vector PDF via real Chrome rendering (CJK, charts, Grid/Flex, JS charts); A4 flowing or fixed-canvas single page; zero-install.
Free
HTML to PDF (High-Fidelity)
Example session with this skill installed
Convert my analytics report at report.html to a PDF. It uses ECharts for the data visualizations and needs to be in A4 format with 20mm margins.
- Read your context and instructions
- Compiled the html to pdf
- Generated the document
I have converted your HTML report to a high-fidelity PDF using the Chromium rendering engine. The process executed all JavaScript to ensure the ECharts visualizations rendered correctly and applied your requested 20mm margins.
Conversion Summary
| Property | Value |
|---|---|
| Input File | report.html |
| Output File | report.pdf |
| Mode | A4 Flowing Document |
| Margins | 20mm 20mm |
| Engine Used | Chrome Headless (CLI) |
| JS Rendering | Enabled (networkidle0 + 300ms) |
| Status | Success |
# Command executed:
node scripts/html2pdf.mjs report.html report.pdf --margin "20mm 20mm"
# Output Verification:
# PDF generated: 4 pages
# Text status: Vector/Selectable
# Font check: PingFang SC / System UI detected
Next steps
- Run
open report.pdfto visually inspect the ECharts rendering. - If charts appear incomplete, increase the wait timer in
scripts/html2pdf.mjsfrom300to1000. - Use
sips -s format png report.pdf --out report_preview.pngto generate a quick thumbnail for preview.
report.html
PDF · document
Example file from a real run - the skill writes it into your workspace.
Connects securely to your tools. The creator never sees your data.
About this skill
Conversion of HTML to PDF often fails when tools ignore JavaScript, break modern CSS layouts, or fail to render CJK characters. This skill uses a real Chromium rendering engine to ensure what you see in the browser is exactly what you get in the PDF.
What it does
- High-fidelity rendering uses a real Chrome/Edge engine to execute JavaScript and render SVG/Canvas.
- Vector output generates selectable, searchable text rather than flat images.
- Dual modes support A4 flowing documents with automatic paging and fixed-size canvas modes for posters.
- Auto-detection finds existing Chrome, Edge, or Puppeteer installations without manual configuration.
- CJK support preserves Chinese, Japanese, and Korean characters using the system font stack.
How it works
- Identify source by pointing the script to your local HTML file and desired output path.
- Select mode based on content type, using default A4 for reports or
--sizefor fixed dimensions. - Execute conversion via
html2pdf.mjswhich automatically selects between Puppeteer or Chrome CLI. - Automated verification triggers a visual check of the output PDF to confirm layout and font integrity.
Frameworks & tools
The tool runs on Node.js and requires an installation of Chrome, Chromium, or Microsoft Edge. It optionally integrates with Puppeteer for advanced control but falls back to the headless CLI if not present.
Why this beats prompting it yourself
Writing a reliable wrapper for headless Chrome involves complex path detection across OSes and handling asynchronous network states for JS-heavy charts. This skill handles the detection logic, paging CSS, and wait-states out of the box.
Use cases
- Report generation for converting data-heavy HTML dashboards with ECharts into A4 PDF reports.
- Marketing assets for exporting high-resolution HTML/CSS posters as single-page vector PDFs.
- Documentation for turning local technical docs into searchable, portable PDF files.
Known limitations
Requires a Chromium-based browser or Puppeteer installed on the host machine. Complex JS charts may require manual adjustments to the wait-state timer in the script for complete rendering.
Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for APIs & Backend.
Requires Node.js and a Chromium-based browser (Chrome/Edge/Puppeteer). JS-heavy charts might need increased wait times in the script if they load slowly.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before buying a skill.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Free to use
No account required to browse
Trust & safety
Security scan
Security scan passed 12 days ago
- Free with an Agensi account