pdf

Generates PDF documents from Markdown files using pandoc and wkhtmltopdf.

Updated Jun 2, 2026
One-click install
npx skills add https://github.com/lfuuu/claude-rules --skill pdf-lfuuu
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: pdf
Source: https://github.com/lfuuu/claude-rules/tree/main/global-skills/pdf
Command: npx skills add https://github.com/lfuuu/claude-rules --skill pdf-lfuuu

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires pandoc, wkhtmltopdf.

What problem does it solve? Converting Markdown documentation into polished PDF files usually requires manual toolchain setup and per-project scripting. This Skill auto-detects existing project PDF scripts, scaffolds templates when none exist, and falls back to an inline pandoc + wkhtmltopdf pipeline, so any project can export .md to .pdf without prior setup. ## Core Features & Use Cases - Auto-detection and scaffolding: Searches for project scripts in scripts/createpdf/, scripts/pdf/, and .claude/scripts/; if missing, copies ready-made templates (shell scripts, CSS, TOC XSL) into the project. - Two generation modes: Single mode converts one Markdown file to PDF; multi mode merges many files listed in a doc-order.txt into one PDF with a title page and table of contents. - Use Case: You have a docs/ folder with a dozen architecture documents. Run multi mode with a doc-order.txt to produce a single PDF report with cover page, TOC, page numbers, and consistent styling. ## Quick Start Ask the agent to generate a PDF from a specific Markdown file, for example: make a PDF from docs/ARCHITECTURE.md.

Frequently Asked Questions about pdf

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I convert Markdown to PDF with pandoc and wkhtmltopdf?

Convert Markdown to HTML with pandoc using the --standalone flag and a CSS file, then render the HTML to PDF with wkhtmltopdf using --enable-local-file-access. Set margins and a footer with page numbers via wkhtmltopdf flags.

How do I merge multiple Markdown files into one PDF with a table of contents?

List the files in a doc-order.txt file, concatenate them with page-break divs between documents, then run wkhtmltopdf with a cover page and the toc option using an XSL stylesheet. Section headers marked with ## in the order file create titled page breaks.

Why do images not render when wkhtmltopdf converts my Markdown?

wkhtmltopdf often fails to resolve relative image paths such as ../diagrams/ from subdirectories. Replace relative paths with absolute paths in a temporary copy of the Markdown before conversion, and always pass --enable-local-file-access.

What dependencies are required for Markdown to PDF conversion?

The pipeline requires pandoc for Markdown-to-HTML conversion and wkhtmltopdf for HTML-to-PDF rendering. Both can be installed on Debian-based systems with apt-get install pandoc wkhtmltopdf.

Can I customize fonts and styling in the generated PDF?

Yes, styling is controlled through CSS files passed to pandoc via --css. The default templates use DejaVu Sans at 14pt with styled tables, code blocks, and page footers, and you can edit the CSS to change fonts, sizes, and margins.