Written and tested by the MD Converter editorial team

How to Print Markdown or Save It as PDF

Learn how to print Markdown or save it as PDF, choose a conversion workflow, control paper and page breaks, and check the final file before sharing.

Three ways to turn Markdown into PDF

There are three common workflows for a specification, manual, report, or proposal written in Markdown.

MethodBest forCheck before committing
Render HTML and print from a browserQuick, one-off filesPrint CSS and browser settings
Export from an editor extensionRepeated output while writingSupported Markdown flavor and extension behavior
Use a CLI such as PandocRepeatable builds and CIInstallation, fonts, and configuration

Most workflows first render Markdown into HTML or another display format and then paginate it with a print engine. A successful conversion is not the final check: reopen the saved PDF and inspect tables, images, code, and page breaks.

Start with a small representative document

Before adjusting a long document, test a short file containing the elements you actually use.

# Monthly report

## Results

- Released the new feature
- Reduced response time

| Metric | Current | Previous |
|---|---:|---:|
| Users | 1,250 | 1,080 |

Keep heading levels logical: an h1 followed by h2 sections, with h3 only where a subsection is needed. A sound hierarchy improves both the body and any generated table of contents. For a guided first run in the browser, see Create a PDF with Markdown Document Converter in Five Minutes.

Set paper, orientation, and margins

A4 portrait is a practical starting point for many office documents. Landscape can work better for wide tables and diagrams. Define the page in print CSS or in the converter's print settings.

@page {
  size: A4 portrait;
  margin: 18mm;
}

body {
  font-size: 11pt;
  line-height: 1.7;
}

Large margins in both CSS and the print dialog can make the content area unnecessarily narrow. Match the paper size and orientation, and disable browser headers and footers when the URL, date, and page title are not required.

Control page breaks

Standard Markdown has no concept of a paper page. A print engine chooses break positions from the paper, margins, fonts, images, and content length. Print CSS can start major sections on a fresh page and ask the engine to keep short elements together.

@media print {
  h1 {
    break-before: page;
  }

  table,
  pre,
  figure {
    break-inside: avoid;
  }
}

An element taller than a page still has to split even with break-inside: avoid. Do not shrink a large table until it becomes unreadable; consider splitting it, removing columns, or using landscape orientation. See the page-break guide and margin guide for more detail.

Add a cover and table of contents when useful

A short memo may need neither. For a versioned specification, proposal, or manual, a cover can record the title, owner, date, and revision. A table of contents helps readers navigate a longer document. For end-to-end practices covering minutes, specs, and resumes, see Markdown for Business Documents: Minutes, Specs, Resumes & PDFs.

Use headings for structure, not merely to enlarge text. Adding front matter changes pagination, so review the first body page and important breaks again afterward.

Save from the browser print dialog

With the rendered HTML visible, open the print command and choose Save as PDF as the destination. Before saving, confirm that:

Browsers and operating systems can paginate fonts and content differently. For recurring documents, use the same conversion environment and saved settings to reduce avoidable variation.

Check external requests in a local workflow

A browser-side or local converter may process the source without sending the document to a conversion server. That does not automatically make the page offline: external images, web fonts, and CDN stylesheets still contact their respective hosts. For confidential material, review the converter's privacy documentation and replace remote assets with local files or embedded data before export.

Preflight the saved PDF

Reopen the file and check:

Markdown-to-PDF work is more than pressing Save. Test a representative sample, fix the source structure, then review the saved pages from the reader's point of view. If you need slides rather than a document, see How to Convert Markdown to Slide PDF with Marp.