How to Control Page Breaks in Markdown PDF — Drag, Click, and Layout Rules
Four ways to control page breaks in Markdown PDF—drag preview handles, click-toggle blocks, Precise page breaks, and Layout rules. Control pagination without editing your .md source.
The problem with page breaks in Markdown PDF output
When converting Markdown documents—specs, reports, meeting notes—to PDF, things often go wrong:
- A heading is stranded at the bottom of a page
- A table is split across two pages
- A key section breaks at an awkward line
Most converters offer little control over where pages break. Markdown Document Converter lets you decide exactly where each page break goes—without touching your Markdown source.
Markdown has no “page” syntax
Markdown is a flowing text format—there is no native “insert page break here.” Pagination happens after HTML conversion, via CSS print properties or the preview/layout UI described below. Embedding <div style="page-break-after: always;"> in .md works in some pipelines but hurts source readability and forces edits whenever layout changes.
Reference: CSS @media print (general case)
When you own the stylesheet, print rules often look like the snippet below. Always verify in print preview—PDF engines may interpret rules slightly differently.
@media print {
h1 {
break-before: page;
}
table, pre {
break-inside: avoid;
}
}
Save as PDF also depends on margins, paper size, orientation, and scaling—not CSS alone.
After you change paper, orientation, cover, or TOC
Changing A4/Letter, portrait/landscape, or adding a cover/TOC can shift where breaks fall. Scroll the whole preview to catch unwanted blank pages (e.g. a “break before heading” rule hitting right after a cover). Re-check breaks around landscape pages if you mix orientations.
Four ways to control page breaks
1. Drag page-break lines in the preview
In the Preview tab, drag the page-break line to move it between block boundaries. Want the next heading to start on a fresh page? Just drag the break up to it. This works without editing your Markdown at all.
Drag as many times as you like to find the right layout before exporting.

Figure: Drag the dashed line in Preview to place the page break where you want it.
2. Click a block to toggle its page break
Click any content block to instantly add or remove a page break before it. Use drag to move existing breaks, and click to add or remove them—combine the two for efficient fine-tuning.
3. Precise page breaks (auto-measured)
The Precise page breaks button measures the actual rendered height of each block and inserts breaks just before a page would overflow. It builds a solid starting layout quickly; then you can drag to refine.
4. Layout rules for the whole document
Under Layout → Page breaks, set rules with a single checkbox:
| Rule | Effect |
|---|---|
| Break before h1 | Every major heading starts on a new page |
| Break before h2 | Every section heading starts on a new page |
| Avoid break inside table | Tables stay on one page |
| Avoid break inside code block | Code blocks stay on one page |
Set document-wide rules here, then use drag for any per-break adjustments.
Keep your Markdown source clean
A common workaround for Markdown page breaks is inserting raw HTML like <div style="page-break-after: always;"></div> directly into .md files. That works, but it clutters your source, means editing Markdown every time the layout changes, and bleeds presentation concerns into content files.
Markdown Document Converter keeps all page-break instructions in the preview and layout settings—your .md file never changes.
Privacy: files never leave your browser
Conversion, preview, and PDF generation all run entirely in your browser. Internal documents, confidential specs, and sensitive reports are safe to use.
Who benefits most
- Engineers distributing technical specs as PDF
- Business users producing polished proposals and reports
- Anyone maintaining Markdown docs who wants real page-break control without raw HTML
How to get started
- Open Markdown to PDF (md to pdf)
- Drop a
.mdfile or paste Markdown text - Switch to the Preview tab to see the full layout
- Set document-wide rules in Layout → Page breaks
- Click Precise page breaks to auto-insert breaks
- Drag the page-break lines to fine-tune positions
- Click Save as PDF and choose "Save as PDF" in the print dialog
Related articles
- How-to & BlogMarkdown PDF Page Breaks — Drag, Click & Auto-Insert Complete GuideControl Markdown PDF page breaks without editing source: drag handles in Preview, click to toggle, auto-insert with Precise mode, combine CSS-based Layout rules, and fix common pagination problems.Read article
- How-to & BlogWhy Markdown PDFs and Print Look Broken — Causes and FixesFix common Markdown-to-PDF and print issues—margins, breaks, missing backgrounds, font substitution, overflowing tables. Includes a triage checklist and browser comparison notes.Read article
- How-to & BlogHow to Convert Markdown to HTML and PDF — Step-by-Step GuideFull guide to Markdown Document Converter: load files, switch view modes, tweak layout, download HTML, save PDF. Step-by-step with screenshots and FAQ for first-time users.Read article
- ToolMarkdown to HTML (md to html)Preview .md in the browser, adjust layout, and download HTML.Open tool