Printing

Print a document on paper. Same pipeline as PDF export: clean stylesheet, no app chrome, optional brand colors. ⌘P or Print… in the toolbar's export menu.

3 min read

Printing in sweetdocs uses the same pipeline as PDF export; they’re literally the same code path. The difference is what you do at the print dialog: pick a real printer for paper, pick “Save as PDF” for a PDF.

Print

Kyoto, days 1-3

We land in Kyoto on the 12th and have three full days before Osaka. The bamboo grove at Arashiyama is best at dawn, Fushimi Inari takes a morning, and the Nishiki food markets are worth a slow afternoon.

  • Reserve the dawn slot at Arashiyama.
  • Pre-book the Nishiki food tour for Saturday.
const total = perDay * 3

The second page continues with Osaka logistics, ramen stops, and the return train.

How to print

PathWhat it does
Doc toolbar → download icon → Print…Opens a clean print tab + the browser’s print dialog
Print dialog → destination Save as PDFA PDF that keeps images; for a one-click PDF use PDF (.pdf) in the same menu
⌘P (in some browsers)Browser’s standard print shortcut; also works

What gets printed

A stripped-down render of just your document:

  • The title at the top
  • The body parsed by marked and sanitized by DOMPurify (same as Preview mode)
  • A clean print stylesheet: system fonts, 720px content width, generous line height
  • No sidebar, no toolbar, no app chrome, just the content

Page boundaries are handled by the browser. Long tables and code blocks paginate naturally; long pre blocks may overflow to the next page rather than wrap.

Brand colors toggle

The print stylesheet has a per-device preference for brand colors. The setting is stored in localStorage under sweetdocs:print_brand_colors:

SettingWhat gets printed
On (default)Headings and links in the theme’s accent color; subtle background on code blocks
OffPure black-on-white; best for greyscale printers, archival, or older laser printers without color cartridges

Toggling this affects every doc you print on this device until you change it back.

Paper, orientation, margins

These are all in the browser’s print dialog; sweetdocs doesn’t override them:

  • Paper size: Letter / A4 / Legal / etc.
  • Orientation: Portrait or Landscape
  • Margins: Default is browser’s “normal” margins; pick “minimum” for content-heavy docs
  • Headers / footers: Browser-injected (URL, page number, date); toggle in the dialog
  • Page ranges: Print only specific pages from the dialog

When you only want one image, table, or section

Print mode renders the whole document. For partial printing:

  • Copy the section as Markdown into a new doc and print that doc, or
  • Use the page-range field in the print dialog after seeing the page count in the preview

What’s not printed

ElementReason
Cursors / collaborator avatarsNot in print mode
Comments panelLives off the body
Sidebar, toolbarStripped; content-only
Hover-only UI (tooltips, etc.)Not in print mode
AnimationsNone

SVG documents

The export menu, and Print… with it, only appears for Markdown docs (the docType === 'md' condition). To print a sweetdocs SVG document, export it from the SVG editor’s toolbar. There’s no integrated print path for SVG in v1.

Cross-browser notes

BrowserNotes
Chrome / Edge / Brave / ArcFull support, “Save as PDF” works
SafariFull support; PDF destination is “Save PDF to Files”
FirefoxFull support, “Save to PDF”
Mobile browsersiOS Safari supports print → AirPrint / Save to Files; Android Chrome supports print → Save as PDF

All major browsers ship the same underlying print pipeline. The print tab + browser dialog combination works the same everywhere.