pdf-export

Convert Markdown study notes into A4 PDF documents using Playwright and Chromium.

Updated Jun 15, 2026
One-click install
npx skills add https://github.com/kmjy98-sketch/khulaw --skill pdf-export-kmjy98-sketch
Or copy as Structured Prompt for Agentโ–ผ
Please help me install this Agent Skill.
Skill: pdf-export
Source: https://github.com/kmjy98-sketch/khulaw/tree/main/.agent/skills/pdf-export
Command: npx skills add https://github.com/kmjy98-sketch/khulaw --skill pdf-export-kmjy98-sketch

SYSTEM DOCUMENTATION & REQUIREMENTS

๐Ÿ’ก This Skill requires markdown, playwright, and includes scripts (resource) components.

What problem does it solve? Manually converting Markdown study notes into printable, exam-ready PDF files is repetitive and error-prone, especially when consistent Korean typography and A4 layout are required across many files. ## Core Features & Use Cases - Batch Conversion: Convert a single Markdown file, multiple files, or all top-level .md files in a folder into PDFs in one run. - Exam-Ready Layout: A4 page size with defined margins, Malgun Gothic Korean fonts, styled headings, striped tables, and footnotes. - Markdown Extensions: Supports tables, fenced code blocks, table of contents, footnotes, and line-break conversion. - Use Case: Before midterms, point the script at your civil law notes folder and generate a dated folder of printable PDFs for offline review. ## Quick Start Convert all Markdown notes in my civil law folder into PDFs and save them to a dated output folder for exam preparation.

Frequently Asked Questions about pdf-export

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

FAQPage Schema
How do I convert Markdown files to PDF in Python?โ–ผ

Convert Markdown to HTML with the markdown package using extensions like tables and footnotes, then render the HTML to PDF with Playwright's Chromium browser via page.pdf(). This approach preserves CSS styling such as fonts, margins, and table formatting.

How to batch convert a folder of Markdown notes to PDF?โ–ผ

Pass the folder path as the --src argument and an output directory as --out. The script collects all top-level .md files in the folder without recursion and converts each one into a same-named PDF in the output directory.

Does Playwright PDF rendering support Korean fonts?โ–ผ

Yes, Chromium renders Korean text using system fonts such as Malgun Gothic when specified in CSS. The font must be installed on the host system, and print_background should be enabled so styled elements appear in the PDF.

Why does Playwright fail when generating PDFs?โ–ผ

The most common cause is a missing Chromium browser binary. Run playwright install chromium before executing the script, and verify the markdown package is installed, since both are required dependencies.

What are the limitations of Markdown to PDF conversion with this approach?โ–ผ

Mermaid diagrams and KaTeX math rendering are not supported, and folder scanning is non-recursive so only top-level .md files are collected. CJK characters like hanja depend on installed system fonts for correct rendering.