Sponsored byOutsenseAI that finds your next clients
SponsorGROUOutbound, LinkedIn content and leads for B2B teamsSponsorOutsenseAI that finds your next clientsAd+Your tool hereSeen by people installing AI tools@Weekly picksThe best new tools, one email a week

md2pdf-export

Skill by wentorai

Converts Markdown files to PDF, PNG, or JPEG using headless Chrome through Puppeteer. It is for users who need printable or publication-ready documents from .md files, and it can also set up the Node.js and Puppeteer environment.

  • Score 59
  • 862 stars
  • NOASSERTION
  • Updated
Works withClaude CodeClaude apps Antigravity CLI

Install md2pdf-export

Built from the published package, never by AI.

git clone --depth 1 https://github.com/wentorai/Research-Claw /tmp/Research-Claw && mkdir -p ~/.claude/skills && cp -r /tmp/Research-Claw/skills/md2pdf-export ~/.claude/skills/md2pdf-export

Run in your terminal. Claude Code loads skills from ~/.claude/skills automatically.

Step-by-step: install md2pdf-export in Claude Code

Skills can run scripts on your machine. Some need an API key: check the README.

About

md2pdf-export converts Markdown files to PDF, PNG, or JPEG. It follows the methodology of VS Code's Markdown Preview Enhanced extension. The script renders the Markdown to a standalone HTML page with markdown-it and plugins for math, syntax highlighting, table of contents, and footnotes. Puppeteer then loads that page in headless Chrome and exports it with page.pdf() or page.screenshot().

The skill covers both environment setup and conversion. A setup script detects the operating system and installs Node.js and Puppeteer. Users can set Puppeteer options in a YAML front-matter block, and a shell loop handles batch conversion of a directory. It is aimed at people who want WYSIWYG-quality output from markdown source files.

Written from the project's SKILL.md and checked against it.

What it can do

  • PDF exportConverts a Markdown file to PDF with page.pdf(), with paper format and margin options.
  • PNG and JPEG exportCreates PNG or JPEG images from a Markdown file using page screenshots, with a JPEG quality setting.
  • Math and syntax highlightingRenders math with KaTeX and highlights code blocks through markdown-it plugins.
  • Front-matter configurationLets users set Puppeteer and screenshot options inside the Markdown file's YAML front-matter.
  • Environment setup scriptDetects the OS and installs Node.js and Puppeteer, then checks that headless Chrome launches.
  • Batch conversionConverts every .md file in a directory with a shell loop.
  • CSS themesOffers github, github-dark, and minimal themes for the rendered output.
  • Table of contentsAdds a table of contents with the --toc option.

What you need

  • Node.js 18 or later
  • Puppeteer, which bundles Chromium, or an existing Chrome or Chromium install
  • Linux, macOS, or a supported Linux distribution such as Ubuntu, Debian, Alpine, or CentOS

Try asking

  • Export paper.md to a landscape A3 PDF with a table of contents.
  • Convert all markdown files in the docs folder to PNG images.
  • Set up Node.js and Puppeteer so I can export markdown to PDF.

Good to know

  • Mermaid diagrams may need a wait delay, such as --wait 2000, to render.
  • A blank PDF can result if the page is not fully rendered before export.
  • Missing CJK characters need extra system fonts such as fonts-noto-cjk.

Security check

C
  • Downloads a script from the internet and runs itIn skills/md2pdf-export/SKILL.md: curl -fsSL https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash
  • Asks for administrator rights (sudo)In skills/md2pdf-export/SKILL.md: sudo

Checked automatically: skills/md2pdf-export/SKILL.md. This looks for known risky patterns and is not a full audit. How grades work

Alternatives to md2pdf-export

All alternatives →

Compare with obsidian-clipper-template-creator, harness-creator or xberg-extracting-with-ocr

md2pdf-export: common questions

Does the output match how Markdown looks in VS Code?

The skill follows the methodology of Markdown Preview Enhanced's chromeExport(). Chrome is the rendering engine, so the output is what Chrome renders from the HTML.

Can I change the page margins for one file?

Yes. The puppeteer block in the file's YAML front-matter accepts margin values such as top, right, bottom, and left.

Can it export Chinese, Japanese, or Korean text?

The troubleshooting notes say missing CJK fonts can cause problems. Installing a CJK font package such as fonts-noto-cjk on Ubuntu is the stated fix.

How do I install md2pdf-export?

Run the command above to copy the skill into ~/.claude/skills/. Claude Code picks it up automatically.

Is md2pdf-export free?

The code is published under the NOASSERTION licence. The service it connects to may have its own pricing.

Is md2pdf-export safe to use?

It scores 59 of 100. Grades: maintenance C, licence F, quality A. Security check: grade C (downloads a script from the internet and runs it). Review the code before you install. How grades work.

What are alternatives to md2pdf-export?

Similar skills: obsidian-clipper-template-creator, harness-creator, xberg-extracting-with-ocr, file-edit-in-place.

md2pdf-export Install

Add to stack

Loading.