Markdown Document Publishing: CSS Paged Media & High-DPI Print Rules
Markdown offers lightweight authoring simplicity, but formatting it for clean physical printing or client deliverables requires print media stylesheets (@media print). Paged media CSS rules prevent orphaned headings, format page breaks between logical sections, and enforce proper physical paper margins (Letter / A4).
1. Essential CSS Print Rules
- break-inside: avoid: Prevents code blocks, figures, and tables from splitting awkwardly across two pages.
- break-after: avoid: Keeps headings attached to their corresponding paragraphs.
- @page { margin: 20mm; }: Defines standardized physical page margins.
Frequently Asked Questions (FAQ)
How does the in-browser Markdown to PDF export work?
The tool parses markdown in real time and applies print-optimized CSS typography. Clicking 'Export to PDF' triggers your browser's high-definition native print engine with all UI elements stripped, allowing 1-click 'Save as PDF' output.
Can I format tables, code blocks, and blockquotes?
Yes. The built-in markdown parser supports GitHub Flavored Markdown (GFM) tables, syntax code blocks, blockquotes, task lists, and horizontal rules.
Is my document text private?
100% private. All rendering, theme styling, and PDF generation happen in your browser's local memory. No text is ever transmitted over the network.