From acedatacloud-content
Converts HTML to a single continuous-page PDF via headless Chrome and PyMuPDF, preserving layout, backgrounds, and selectable text. Supports string redaction and leak verification.
How this skill is triggered — by the user, by Claude, or both
Slash command
/acedatacloud-content:onepage-pdfThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
> Vendored from [github.com/xntj-ai/onepage-pdf](https://github.com/xntj-ai/onepage-pdf)
Vendored from github.com/xntj-ai/onepage-pdf by 张拼拼 · XNTJ, under the MIT License. See LICENSE.
Render HTML to one tall PDF page via headless Chrome, then crop the page to the real content height with PyMuPDF. Height is never predicted (print layout is not screen layout); it is measured after rendering, which is exact.
Requires: Python with pymupdf, plus a local Chrome or Edge. No API token.
Read the HTML and check four things; they decide whether --extra-css is needed:
@page size. Any @media (max-width: N) with
N ≥ 741 will fire during print and collapse the desktop layout. For each such
rule, write an override locking the desktop value with !important
(e.g. .grid{grid-template-columns:repeat(3,1fr)!important}).backdrop-filter blur is silently dropped in PDF output.
If glass elements sit on busy backgrounds, add a print fallback:
.glass{backdrop-filter:none!important;background:rgba(255,255,255,.88)!important}.fade*, reveal*,
animate*, aos) are forced visible automatically. Anything else that
starts at opacity:0 needs an explicit opacity:1!important override.min-height:100vh hero becomes ~187in tall on the bedrock
page. Override such rules with fixed px values.Put all overrides in one CSS file and pass it via --extra-css.
Paths below are relative to this skill directory.
python scripts/onepage_pdf.py input.html -o output.pdf --width 1280 \
[--extra-css fixes.css] [--replace subs.json --forbid words.txt]
--width: match the design width of the page (snapped to 8px; non-8px
page sizes hit MediaBox rounding bugs that spawn phantom pages).--replace: JSON [["old","new"], ...], applied in order — put longer /
more specific strings first. Use for redaction before publishing.--forbid: one word per line; the script aborts if any survives in the
HTML or in the final PDF text layer. Always pair with --replace.--crop pixel: switch to raster row-scanning if the vector crop misjudges
(e.g. a decorative element painted taller than the real content).The script self-handles: oversized-bedrock rendering with auto-retry on overflow, content cropping (MediaBox + CropBox rewritten identically for viewer compatibility), CJK-safe output paths, single-page assertion.
A bundled example lives in examples/ — try it end to end:
python scripts/onepage_pdf.py examples/demo.html -o /tmp/demo.pdf \
--width 1280 --extra-css examples/demo-fixes.css
The script prints OK 1 page, WxHpt. Then:
import pymupdf
doc = pymupdf.open("output.pdf")
doc[0].get_pixmap(dpi=40).save("check.png")
Read references/mechanics.md when output looks wrong (collapsed layout, missing backgrounds, blank page, phantom second page, blurry or missing CJK glyphs) — it documents the Chrome print-rendering rules this tool is built around, plus the CDP-based alternative route.
npx claudepluginhub acedatacloud/skills --plugin acedatacloud-contentConverts HTML to PDF with pixel-perfect rendering using Puppeteer. Supports Hebrew/RTL, auto-fit, and CSS3/HTML5. Useful for generating PDFs from HTML files, URLs, or piped content.
Converts HTML files, URLs, or piped content to PDF using Puppeteer for pixel-perfect rendering and Hebrew/RTL support.
Saves a live webpage as a high-fidelity PDF using agent-browser CLI, handling lazy-loaded images and JS-heavy sites.