Printing¶
OctoEdit prints the active document with its syntax colouring, a header and a footer, through the system's own print dialogs. The three commands live in the File menu:
| Command | Shortcut | What it does |
|---|---|---|
| Print… | — | Opens the system print dialog and prints the document (or the selection). |
| Print Preview… | — | Shows the pages exactly as they will print, with its own Print button. |
| Page Setup… | — | Chooses the paper size, orientation and margins used by every print. |
The commands are available on any editor tab, read-only and monitored buffers included — printing never writes to the file. On a tab that owns no document (a compare view, for example) they are greyed out.
What ends up on paper¶
- Colours come from the light theme, always. Whatever theme you use on screen, the page is rendered with the built-in light colour scheme on white paper, so a dark theme never puts pale ink on a white sheet. You can switch to plain black and white in Preferences.
- The editor font, at its configured size. The on-screen zoom is ignored; use Size adjustment in Preferences to print larger or smaller.
- A header and a footer on every page — by default the file name at the
top and
page / totalat the bottom. Both are templates you can edit or empty (see below). - Line numbers if you enable them, whether or not they are shown on screen.
- Long lines wrap to the page width by default; you can have them clipped instead.
Selection, caret line, indentation guides and folding are screen aids and never print. Folded regions print in full.
Printing a selection or a page range¶
With text selected, the print dialog offers its Selection option; only the
selected text is printed. A page range entered in the dialog applies to the
paginated output — pages are counted the way the footer counts them, so
2-3 prints the second and third sheets and their footers still say 2 / N
and 3 / N. A range outside the document is reported instead of printing an
empty sheet.
Very long documents are confirmed first: above 500 pages OctoEdit asks before sending the job.
Print Preview¶
File ▸ Print Preview… lays the document out on the same pages a print would use and shows them at any zoom. Its toolbar lets you:
- switch between portrait and landscape,
- open Page Setup for the paper size and margins,
- print straight from the preview.
Anything you change here is used by the print you start from the preview and remembered for the next print and the next launch, the same way Page Setup is.
Note
The single page, facing pages and overview buttons only change how the preview window shows the pages. They are not print options — they do not put several pages on one sheet. Multi-page-per-sheet, duplex and similar options belong to the printer's own preferences in the print dialog.
Page Setup¶
File ▸ Page Setup… opens the system page-setup dialog. The paper size, orientation and margins you choose are stored with the editor's settings and applied to every later print and preview, across restarts. The default paper is A4 or Letter depending on your system's measurement system; the default margins are 15 mm.
The same dialog is reachable from the Page Setup… button on Preferences ▸ Printing, where a summary line shows the current layout.
Preferences ▸ Printing¶
| Setting | What it does |
|---|---|
| Colours | Colour (the light theme's colours on white paper — the default) or Black and white. |
| Print line numbers | Adds the line-number gutter to the page, independent of the on-screen setting. |
| Wrap lines that are wider than the page | On by default. Off clips long lines at the right margin. |
| Size adjustment | Points added to (or taken off) the font size for printing only, from −10 to +20. |
| Header / Footer | Templates for the two bands. Leave a field empty to print no band at all. |
| Page Setup… | The paper, orientation and margins — the same dialog as File ▸ Page Setup…. |
Header and footer placeholders¶
| Placeholder | Prints |
|---|---|
$(NAME) |
The file name (Untitled for a new buffer). |
$(FILE) |
The full path (empty for a new buffer). |
$(PAGE) |
The page number. |
$(PAGES) |
The total number of pages. |
$(DATE) / $(TIME) |
The current date / time in your locale's short format. |
Any other text is printed as written, so a mistyped placeholder such as
$(TITLE) shows up verbatim on the page rather than disappearing. The
defaults are $(NAME) for the header and $(PAGE) / $(PAGES) for the footer.
Shortcuts¶
None of the three printing commands has a default shortcut, on any platform:
Ctrl+P (⌘P on macOS) is Go to File, which most people use far more
often than the printer. If you print regularly, assign a chord to Print,
Print Preview or Page Setup in Preferences ▸ Shortcuts;
the commands are also one keystroke away in the Command Palette.
When something goes wrong¶
- No printer installed — neither the print dialog nor Page Setup can open, and OctoEdit says so instead of staying silent. On Windows the built-in Microsoft Print to PDF printer is always available. On macOS the print sheet offers Save as PDF, but only once at least one printer is set up in System Settings ▸ Printers & Scanners — without one, the system provides no page-setup or print sheet at all.
- The printer reports an error — a message names the document; nothing else changes.
- Copies — if the printer cannot produce multiple copies itself (printing to a file, for instance), OctoEdit prints them, collated or not as chosen in the dialog.