Skip to content

Add html-to-pdf-hires skill#246

Open
MMTTGL wants to merge 1 commit intovercel-labs:mainfrom
MMTTGL:add-html-to-pdf-hires
Open

Add html-to-pdf-hires skill#246
MMTTGL wants to merge 1 commit intovercel-labs:mainfrom
MMTTGL:add-html-to-pdf-hires

Conversation

@MMTTGL
Copy link
Copy Markdown

@MMTTGL MMTTGL commented May 5, 2026

Summary

Adds the html-to-pdf-hires skill to skills/.

It converts an HTML file or URL into a pixel-perfect, high-DPI rasterized PDF by screenshotting each .page element at configurable DPR (default 3x) via Puppeteer and embedding the PNGs full-bleed into a fresh A4 PDF. Triggers on phrases like "convert this HTML to PDF", "export this deck to PDF crisply", or "the PDF you made looks blurry".

Also handles slide-style decks where only one slide is visible at a time (--activate-class=<name>), custom selectors, formats, orientation, and DPR.

Layout

skills/html-to-pdf-hires/
├── SKILL.md         # frontmatter (name/description/license/metadata) + relative-path usage
├── README.md
├── LICENSE          # MIT
├── package.json     # puppeteer dependency
└── scripts/
    └── convert.js   # the converter (Node, not bash — see note below)
skills/html-to-pdf-hires.zip

Note on script language

AGENTS.md recommends bash scripts under scripts/. This skill is Node + Puppeteer (the whole point is headless Chrome control), so the script is scripts/convert.js. Other content-only skills in this repo (e.g. composition-patterns, react-native-skills) also depart from the bash convention, so I followed precedent. Happy to refactor if you'd prefer a scripts/run.sh wrapper.

Source

Mirrored from https://github.com/MMTTGL/html-to-pdf-hires (MIT, © Primarch Systems Inc.).

Test plan

  • cd skills/html-to-pdf-hires && npm install
  • node scripts/convert.js path/to/some.html out.pdf produces a multi-page PDF (one page per .page element)
  • --landscape, --format=Letter, --dpr=4, --selector=.slide all behave as documented
  • Slide-deck mode: --selector=.slide --activate-class=active --landscape cycles the active class and emits one page per slide

Pixel-perfect HTML→PDF converter via 3x DPR Puppeteer screenshots
embedded full-bleed into a fresh A4 PDF. Use when vector PDF output
looks blurry or the user asks to export a deck/presentation crisply.

Source: https://github.com/MMTTGL/html-to-pdf-hires
License: MIT
@vercel
Copy link
Copy Markdown

vercel Bot commented May 5, 2026

@MMTTGL is attempting to deploy a commit to the Vercel Team on Vercel.

A member of the Team first needs to authorize it.

@socket-security
Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addednpm/​puppeteer@​22.15.0931008950100

View full report

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant