Markdown PDF Page Breaks — Drag, Click & Auto-Insert Complete Guide

Control 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.

What you'll learn

Aimed at anyone who needs clean PDF pagination for specs, reports, proposals, or academic documents.


Why manually adjust page breaks?

Markdown is a flowing text format with no native page concept. After HTML conversion, CSS print properties (page-break-after, break-before, break-inside) decide where pages break. Auto-pagination often produces:

You can embed <div style="page-break-after: always;"> in .md, but that hurts readability and forces edits whenever layout changes. Markdown Document Converter keeps all break logic out of the Markdown file—adjustable purely from the Preview UI.


5 ways to control page breaks in Markdown PDF

MethodWhereBest forEdits Markdown?
Drag in PreviewPreview panelMoving an existing break slightlyNo
Click a blockPreview panelAdding or removing a breakNo
Layout rulesLayout settings panelApplying document-wide CSS print rulesNo
Precise page breaks (auto)Toolbar buttonLong documents, bulk auto-paginationNo
Inline HTMLMarkdown sourceCI/CD pipelines, tool-free workflowsYes

The first four methods can be combined freely without touching the Markdown source.


Drag page-break lines in Preview

Step-by-step

While dragging, block boundaries highlight so you can see exactly where the break will land.

Dragging a page-break line in the preview panel

Figure: Page boundaries appear as dashed lines in Preview. Drag the center handle to reposition.

Close-up of the draggable handle on a page-break line

Figure: Drag the handle up or down to move the break between block boundaries.

How drag works


Click vs drag — when to use each

ActionEffectBest for
Click a blockToggle a page break on / off before that blockAdding a new break or removing one
Drag the lineMove an existing break to a new boundaryRepositioning, fine-tuning

Typical workflow: click to add the break, then drag to the exact spot you need.


Combining with Layout rules

Under Layout Settings → Advanced → Page breaks, set document-wide rules:

RuleEffectUse case
Break before h1Every major heading starts on a new pageReports with separate chapters
Break before h2Every section heading starts on a new pageSpec and design documents
Avoid break inside tableTables stay on one pageData-heavy comparison tables
Avoid break inside code blockCode blocks stay on one pageAPI references, technical docs

These rules apply as CSS break-before and break-inside properties on the rendered output. Set the document-wide foundation with rules first, then fine-tune individual positions with drag.

Recommended workflow:

Working "rules → auto → drag" makes large documents much faster to paginate.


Precise page breaks + drag

The Precise page breaks button measures the actual rendered height of every block and inserts breaks just before a page would overflow. It creates a solid baseline quickly; then drag to:

For documents of 10+ pages, "auto then fine-tune" is almost always faster than placing every break manually.


Common page-break problems and fixes

Heading stranded at the bottom of a page

Symptom: An ## 2. Overview heading sits alone at the bottom of a page while the content starts on the next.

Fix: Enable Break before h2 in Layout settings, or click the heading block to add a manual break before it.


Table split across pages

Symptom: A table header and its rows are on separate pages, or a table breaks in the middle.

Fix:


Code block cut in half

Symptom: Code is split by a page boundary, making it hard to read.

Fix: Enable Avoid break inside code block in Layout settings. For very long code blocks that can't fit on one page, add a manual break at a logical point in the code.


Break won't move when dragging

Symptom: Dragging does nothing, or the break snaps back to its original position.

Fix: Check Layout settings for rules that pin breaks (e.g. "break before h1"). Disable the rule temporarily, adjust with drag, or delete and re-add the break at the new position.


PDF looks different from Preview

Symptom: Preview looks clean but the exported PDF has different break positions.

Fix:

See Why Markdown PDFs and Print Look Broken for details.


Document typeLayout settingsNotes
Engineering specsBreak before h2 + avoid break in tableSections start on new pages; tables stay intact
Business proposalsBreak before h1 and h2Chapters cleanly separated
API referenceAvoid break in code blockCode stays readable
Meeting minutes / manualsAvoid break in tableTables always display intact
Academic reportsBreak before h1 + manual dragFine-tune to match submission format

Privacy: files stay in your browser

Conversion, preview, and PDF generation run entirely in your browser. No uploads—safe for internal specs, contracts, and confidential content.


FAQ

Dragging does nothing—the break won't move

Document-wide rules in Layout (e.g. "break before h1") can constrain where breaks land. Check and adjust those rules first, then try dragging again.

Can I write page breaks directly in the Markdown file?

Yes—<div style="page-break-after: always;"></div> works. But this tool recommends keeping breaks outside the source for cleaner Markdown and easier layout iteration.

Are page break positions saved?

Yes—the session preserves your settings through page reloads. After exporting HTML or PDF and reopening the tool, you may need to re-apply them.

The PDF looks different from the Preview

Reset the print dialog margin preset to "Default" and set zoom to 100%. Match paper size (A4/Letter) to what Preview uses. See Why Markdown PDFs and Print Look Broken.

After adding a cover or TOC, my breaks shifted

Cover and TOC pages change the total page count, so break positions can appear to shift. Finish configuring the cover and TOC before finalizing page breaks.

Should I use Layout rules or Precise page breaks first?

Set Layout rules first. When you then run Precise page breaks, auto-insertion respects those rules and produces a more natural result.

Is there automatic page numbering?

Not built in. For page numbers, add them manually in the Markdown source or use a PDF editor (e.g. Adobe Acrobat) after exporting.

Can I use paper sizes other than A4?

Yes—select A4, Letter, Legal, or others in the browser print dialog. Make sure the same paper size is selected in both the Preview layout settings and the print dialog; mismatched sizes will cause break positions to differ.