Printing
Print a document on paper. Same pipeline as PDF export — clean stylesheet, no app chrome, optional brand colors. ⌘P or the toolbar print icon.
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.
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 * 3The second page continues with Osaka logistics, ramen stops, and the return train.
How to print
| Path | What it does |
|---|---|
| Doc toolbar → print icon | Opens a clean print tab + the browser’s print dialog |
| Doc toolbar → download icon → PDF (via Print) | Same dialog — but you’d pick “Save as PDF” instead of a printer |
| ⌘P (when the print icon is focused, or in some browsers globally) | 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
markedand 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:
| Setting | What gets printed |
|---|---|
| On (default) | Headings and links in the theme’s accent color; subtle background on code blocks |
| Off | Pure 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:
- 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
| Element | Reason |
|---|---|
| Cursors / collaborator avatars | Not in print mode |
| Comments panel | Lives off the body |
| Sidebar, toolbar | Stripped — content-only |
| Hover-only UI (tooltips, etc.) | Not in print mode |
| Animations | None |
SVG documents
The print icon 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
| Browser | Notes |
|---|---|
| Chrome / Edge / Brave / Arc | Full support, “Save as PDF” works |
| Safari | Full support; PDF destination is “Save PDF to Files” |
| Firefox | Full support, “Save to PDF” |
| Mobile browsers | iOS 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.