pdf-paginated
Skill3 starsChanged 3 months agoMITView on GitHub
Exports document-flow HTML to a PAGINATED PDF at a real paper size (Letter/A4), with a running folio footer (title · page X / Y). The long-form sibling to pdf-html: where pdf-html renders each .canvas to one tall auto-height page (right for social artifacts and audit reports), this paginates a whole document across pages — right for essays, field guides, specs, and anything meant to be read or printed as pages.
In this repository18 other files it gives its agents.
- design-blog-heroSkill
- design-business-cardSkill
- design-carousel-slideSkill
- design-instagram-postSkill
- design-landing-pageSkill
- design-linkedin-postSkill
- design-link-in-bioSkill
- design-newsletter-headerSkill
- design-planSkill
- design-quote-cardSkill
- design-systemSkill
- design-twitter-cardSkill
- design-ui-componentsSkill
- design-youtube-channel-artSkill
- design-youtube-thumbnailSkill
- figure-auditSkill
- pdf-htmlSkill
- screenshot-htmlSkill
The file
We split this skill into the rules it gives an agent
3 rules. About 0 are common, 2 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 27
When the output should be Letter or A4 with real margins and page numbers, not a single tall canvas.
- Distinctive: line 69
Default mode gives white paper margins.
- Very specific: line 82
keep the reading column measured (max-width) and centered.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Skill: pdf-paginated
Paginated document PDF via headless Chromium page.pdf({format, margin}). No
.canvas targeting — the whole document flows across paper pages. A folio footer
(title left, page X / Y right, JetBrains Mono) is rendered in the bottom margin.
When to use
- Long-form documents where the reader expects pages: an essay, a field guide, a spec, a report body, a letter.
- When the output should be Letter or A4 with real margins and page numbers, not a single tall canvas.
Skip if:
- The artifact is a fixed-size design canvas (social post, business card, blog
hero, audit-report canvas). Use
pdf-html— it sizes the PDF to the canvas. - You want a PNG. Use
screenshot-html.
The HTML it expects
Plain document-flow HTML, NOT the .canvas convention:
- Content flows normally (
body→article). No fixed-width.canvaswrapper. - Give the reading column a measure with
max-width(e.g.64ch) centered, and put the page surface color onbody(it prints becauseprintBackgroundis on). - Do not set
@pagesize/margins in CSS — the script owns paper size and margins via--format/--margin. A CSS@pagemargin would double up. - Optional
@media printrules to keep things tidy across page breaks:h2, li { break-inside: avoid; }andh2 { break-after: avoid; }. - Set a clean
<title>— it becomes the footer's running head. - Self-contained styles (inline
<style>or a resolvable@import); web fonts load fine (the script waits fordocument.fonts.ready).
How to run
node skills/pdf-paginated/scripts/pdf-paginated.mjs <dir> [--output <dir>] [--format Letter|A4] [--margin <css>] [--bleed <color>] [--no-footer]Flags:
<dir>(positional, default.): directory scanned recursively for*.html.screenshots/,pdfs/, and hidden dirs are skipped.--output <dir>(default<dir>/pdfs): where PDFs are written, one per HTML file.--format(defaultLetter):LetterorA4.--margin(default0.9in): CSS length applied to all four sides. Ignored in bleed mode.--bleed <color>: full-bleed page surface. See below.--no-footer: drop the folio footer (in bleed mode the footer strip still paints).
Full-bleed backgrounds (--bleed <color>)
Default mode gives white paper margins. If the document has a committed
background color (e.g. a cream editorial page), that background floats as a card
on white — the margins show through. --bleed <color> fixes this: it zeroes the
left/right margins so the HTML background reaches the side edges, and paints the
top and bottom margin strips <color> so every page is that color edge-to-edge,
with a per-page inset and no white bands. The folio still renders in the bottom
strip.
In bleed mode the HTML owns only its side text insets (via body padding);
the top/bottom insets are the painted strips. So the HTML should:
- set the surface color on
htmlandbodywithprint-color-adjust: exact, - pad only the sides (e.g.
padding: 0.1in 0.95in 0.3in), and - keep the reading column measured (
max-width) and centered.
# cream editorial essay, full-bleed
node skills/pdf-paginated/scripts/pdf-paginated.mjs . --output ./pdfs --bleed '#fbfaf9'Prerequisites
None — self-bootstraps on first run, installing Playwright + Chromium into its
own node_modules next to the script (shared pattern with pdf-html /
screenshot-html). First run ~10–60s; subsequent runs are fast.
Relationship to pdf-html
| pdf-html | pdf-paginated | |
| Output | one auto-height page per .canvas | document paginated across paper pages |
| Sizes to | canvas pixel dimensions | Letter / A4 + margins |
| Footer | none | folio (title · page X / Y) |
| Use for | social artifacts, audit-report canvases | essays, field guides, specs, reports |
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

