markdown-to-pdf

markdown-to-pdf is a skill for Claude Code from kennethkhoocy/applied-micro-skills. It costs 188 tokens per session (1,602 once invoked), scanned A, original, MIT.

A tool for turning Markdown files into PDFs by rendering them as web pages first. Markdown is plain-text formatting used for documents such as README files, and the process preserves images and supports GitHub-style content.

In plain words
What is it for?
Use it to export README files, notes, and other Markdown documents as PDFs with images, tables, code blocks, and links retained.
Why use it?
It avoids broken Unicode, overflowing tables, missing images, and layouts that differ from the Markdown viewed in a browser.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: reads .claude/ paths; mentions Claude Code.

Part of the applied-micro plugin — 17 skills shipped together

Good fit Use it to export README files, notes, and other Markdown documents as PDFs with images, tables, code blocks, and links retained.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/kennethkhoocy/applied-micro-skills/markdown-to-pdf
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add kennethkhoocy/applied-micro-skills --skill markdown-to-pdf
Clone the repo
git clone --depth 1 https://github.com/kennethkhoocy/applied-micro-skills

Made for: Claude Code.

Or install applied-micro, the plugin that ships this one along with the rest of its 17 skills.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for markdown-to-pdf

README.md
[![agentmods](https://agentmods.dev/badge/skills/kennethkhoocy/applied-micro-skills/markdown-to-pdf/github.svg)](https://agentmods.dev/skills/kennethkhoocy/applied-micro-skills/markdown-to-pdf)
Your own site
<a href="https://agentmods.dev/skills/kennethkhoocy/applied-micro-skills/markdown-to-pdf"><img src="https://agentmods.dev/badge/skills/kennethkhoocy/applied-micro-skills/markdown-to-pdf/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for markdown-to-pdf

Your own site · 80×15
<a href="https://agentmods.dev/skills/kennethkhoocy/applied-micro-skills/markdown-to-pdf"><img src="https://agentmods.dev/badge/skills/kennethkhoocy/applied-micro-skills/markdown-to-pdf.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 188 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,602 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00188 $0.01602
Opus 5 $0.00094 $0.00801
Sonnet 5 $0.00038 $0.00320
Haiku 4.5 $0.00019 $0.00160

Measured 11d ago against content hash 581c9503aa9a, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

markdown-to-pdf scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 11d ago.

The scan reads SKILL.md. This mod also ships 1 executable file (scripts/md2pdf.py), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

Origin

Copies of this mod

1 near-identical copy found in the catalogue:

plugins/applied-micro/skills/markdown-to-pdf/SKILL.md · 131 lines

How it starts

The opening of the file, as written. The whole thing — 131 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Markdown → PDF (pandoc + headless Chrome)

Problem

Converting Markdown to PDF through pandoc's default LaTeX route breaks on real-world GitHub-flavored documents: Unicode box-drawing characters in code blocks (├──) crash pdflatex, wide GFM tables overflow the page, remote images need manual download, and the output looks nothing like the rendered Markdown the author reviewed. Naive HTML routes drop images or paste them at native resolution so they spill off the page.

Context / Trigger Conditions

  • User asks to save/convert/export a .md file as PDF.
  • The document carries images (hosted PNGs, local figures), GFM tables, fenced code blocks, blockquotes, or #-anchor TOC links.
  • Requirements like "all images must be preserved" or "scaled appropriately".

Solution

Render the Markdown to HTML exactly as a browser would, then print it.

One command (preferred):

python ~/.claude/skills/markdown-to-pdf/scripts/md2pdf.py <input.md> [-o out.pdf]

The script: (1) runs pandoc -f gfm -t html5 --standalone --embed-resources with assets/print.css, executed from the Markdown's own directory so relative image paths resolve, and with remote images fetched and inlined as data URIs; (2) prints with headless Chrome (Edge/Chromium fallback) using --no-pdf-header-footer --virtual-time-budget=30000; (3) verifies with pypdf that the embedded raster-image count is at least the number of image references in the source, printing each image's page and dimensions. Exit code 2 flags a missing-image warning.

Manual equivalent (what the script automates):

pandoc input.md -f gfm -t html5 -s --embed-resources -c print.css \
    --metadata pagetitle="input" -o /tmp/input.html
"/c/Program Files/Google/Chrome/Application/chrome.exe" --headless \
    --disable-gpu --no-pdf-header-footer --virtual-time-budget=30000 \
    --print-to-pdf="out.pdf" "file:///tmp/input.html"

Why this works for images. The stylesheet constrains every image with max-width: 100%; max-height: 240mm; width/height: auto; break-inside: avoid, so each image scales to the printable width, a very tall diagram still fits a single page, aspect ratio is preserved, and no image is split across a page break. --virtual-time-budget makes Chrome wait for image loading before printing; --embed-resources makes the HTML self-contained so nothing depends on the network at print time.

Read the full file on GitHub · 131 lines

Files

What ships with it

3 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 11d ago First seen · 131 lines · 188 tokens per session scan A 581c9503aa9a

Subscribe to this mod's changes

markdown-to-pdf is a skill published in the GitHub repository kennethkhoocy/applied-micro-skills (28 stars, last pushed 6d ago), licensed MIT. It adds 188 tokens to every session and 1,602 once invoked, about $0.0009 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

download-fulltext-pdf

A skill for downloading a research paper's complete PDF using an identifier such as a DOI, title, or BibTeX entry.

huangwb8/skills · 105 tokens

report-helper

A Chinese-language research workflow that searches the internet and produces a formatted PDF report about a specified topic.

Jiaranbb/report-helper · 92 tokens

pdf

Use this skill whenever the user wants to do anything with PDF files. This includes reading or extracting text/tables/formulas from PDFs (including scanned and photographed documents), OCR, combining or merging multiple PDFs, splitting, rotating, watermarking, creating new PDFs, encrypting/decrypting, and extracting…

kennethkhoocy/legal-scholarship-skills · 143 tokens

pdf-analyze

Comprehensive PDF manipulation toolkit for extracting text and tables, creating new PDFs, merging/splitting documents, and handling forms. When Claude needs to fill in a PDF form or programmatically process, generate, or analyze PDF documents at scale.

aiskillstore/marketplace · 52 tokens

pdf-processing

Extract text and tables from PDF files, fill forms, merge documents. Use when working with PDF files or when the user mentions PDFs, forms, or document extraction.

aiskillstore/marketplace · 36 tokens

searchcans-reader-seo-audit

Extract a URL, PDF, or Office document with SearchCans Reader API and audit web-to-Markdown extractability plus SEO-ready HTML signals such as canonical URL, H1s, meta description, and JSON-LD. Use when diagnosing web-content extraction, preparing RAG inputs, checking dynamic pages, or reviewing a page's basic SEO/GEO…

SearchCans/searchcans-skills · 86 tokens