agentleFS
israelsabaisraelsaba/html-to-pdf-skill/SKILL.md

html-to-pdf

Skill1 starsChanged 3 months agoMITView on GitHub

Use when converting one or more public website URLs into high-fidelity PDFs from browser-rendered screenshots, with cookie-consent handling, URL/timestamp provenance footers, and a configurable output folder.

10 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

11 rules. 0 are common, 8 are distinctive, and 3 are very specific to this project.

  • 0

    Common

    Most of the 7 edited versions we read keep these.

  • 8

    Distinctive

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Use the browser-rendered screenshot workflow rather than page.pdf() or a browser print dialog when visual fidelity is the priority.

    line 8
  2. Distinctive:

    Run the renderer from the skill directory with one URL or a list of URLs and choose the output folder:

    line 12
  3. Distinctive:

    Wait for DOM content, fonts, network activity, lazy-loaded content, and images to settle.

    line 36
  4. Distinctive:

    Search every frame for common cookie-consent controls.

    line 37
  5. Distinctive:

    Remove advertising iframes, ad slots, publicity overlays, and their reserved blocks without removing article content.

    line 40
  6. Distinctive:

    Add a footer to each captured page containing the source URL and the local access timestamp.

    line 42
  7. Distinctive:

    Keep the browser viewport and locale explicit for reproducible output.

    line 47
  8. Distinctive:

    Do not remove the provenance footer from public-source captures.

    line 48
  9. Distinctive:

    Do not preserve advertisements or ad placeholders in the generated PDF.

    line 49
  10. Very specific:

    Treat a Leia mais control belonging to the article body as a content control that should be expanded when possible.

    line 50
  11. Very specific:

    If a consent banner remains, add its selector to accept_consent in ~/.config/opencode/skills/html-to-pdf/render_with_provenance.py and …

    line 51

“Common” is measured: kept by at least 6 in 10 of the 7 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

HTML to PDF

Use the browser-rendered screenshot workflow rather than page.pdf() or a browser print dialog when visual fidelity is the priority. This preserves the page's loaded fonts, responsive layout, images, colors, and fixed-position elements as seen in Chromium.

Command

Run the renderer from the skill directory with one URL or a list of URLs and choose the output folder:

python3 "$SKILL_DIR/render_with_provenance.py" \
  --output-folder html-to-pdf \
  https://example.com/page-a \
  https://example.com/page-b

For pages that require an existing Chrome login, use a temporary copy of the saved Chrome user-data directory. Do not launch against a profile that is currently open in Chrome:

python3 "$SKILL_DIR/render_with_provenance.py" \
  --chrome-profile /path/to/copied-chrome-profile \
  --profile-directory Default \
  --output-folder html-to-pdf \
  https://example.com/private-page

The output filename is derived from each URL path. If no output folder is supplied, PDFs are written to html-to-pdf/.

Workflow

  1. Launch Chromium through Playwright with a fixed desktop viewport and a high device scale factor.
  2. Wait for DOM content, fonts, network activity, lazy-loaded content, and images to settle.
  3. Search every frame for common cookie-consent controls. Accept the broadest consent option before capturing the page.
  4. Expand visible Leia mais controls before capture.
  5. Dismiss blocking sign-in, cookie, and modal overlays using their visible close or dismiss controls.
  6. Remove advertising iframes, ad slots, publicity overlays, and their reserved blocks without removing article content.
  7. Capture one viewport at a time while scrolling through the full document.
  8. Add a footer to each captured page containing the source URL and the local access timestamp.
  9. Combine the images into a PDF and inspect page count, dimensions, and readability.

Notes

  • Keep the browser viewport and locale explicit for reproducible output.
  • Do not remove the provenance footer from public-source captures.
  • Do not preserve advertisements or ad placeholders in the generated PDF.
  • Treat a Leia mais control belonging to the article body as a content control that should be expanded when possible. Do not open recommendation widgets such as Veja mais notícias.
  • If a consent banner remains, add its selector to accept_consent in ~/.config/opencode/skills/html-to-pdf/render_with_provenance.py and rerun.
  • A screenshot-based PDF is intentionally image-based. Use browser print/PDF only when selectable text is more important than pixel fidelity.
  • Capture only pages the user is authorized to access. Do not copy cookies, credentials, or private browser profiles into the repository or output folder.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.