Export as PDF

Save a clean, printable PDF of any file. It's made on your device; the file never leaves it.

Run Export as PDF from the command palette (the button at the top of the page, or CTRL/CMD+P). A dialog shows the page setup and a preview of the pages. Save as PDF… opens your browser's print dialog; choose Save as PDF as the destination (on iPhone and iPad, share the preview or save it to Files).

PrintedHeadings, lists, task boxes, tables, code, callouts (folded ones open), <details> sections (open), Mermaid diagrams, math and vault images
Left outFrontmatter, comments and other raw HTML
LinksWeb links stay clickable; wikilinks print as their text
LookAlways light, whatever your theme, with page breaks that keep rows, code blocks and headings together

Set the page up in the dialog; your choices are remembered for the next export.

PaperA4 (the default) or Letter
MarginsNarrow, Normal (the default) or Wide
Header and footerText with {title}, {date} (the export day), {page} and {pages}, e.g. {title} | {date} or {page} / {pages}. On its own it's centred; | splits it into left | right, or left | centre | right. Leave it empty for none.
Page breaksA line that's exactly <!-- pagebreak --> starts a new page. Turn on New page at each rule to break at every horizontal rule (---) too.
PreviewFollows your choices as you make them. Each page break starts a new sheet; long sections run onto more pages when printed, and faint lines show roughly where

The PDF's title comes from the file's first heading, or its file name. A file marked private can only be exported once you've shown it. CTRL/CMD+P still opens the command palette.