TreePress
Your code, exactly as you see it — in PDF.
TreePress exports any file open in VS Code to a pixel-faithful, searchable
PDF. It captures your editor's exact syntax colours and theme, so the PDF
looks identical to what you see on screen. No configuration required — open
a file, run the command, and download.
Features
- Pixel-faithful rendering — uses headless Chromium to capture colours,
fonts, and layout exactly as VS Code renders them
- Searchable PDF — an invisible text layer makes every exported PDF
copyable and searchable
- Table of Contents — PDF bookmarks generated automatically from code
symbols and Markdown headings
- Theme support — exports using your active VS Code theme, or pick any
installed theme from the options panel
- Markdown rendered export — render Markdown as a formatted document
(headings, tables, code blocks) or export the raw source
- Jupyter Notebook support — exports code cells and output cells
including images
- Git footer stamp — optionally prints branch, commit hash, author, and
date on every page
- Preview before download — review the PDF in an in-editor panel, tweak
options, and re-render before saving
Requirements
VS Code 1.90 or later.
How to Use
Three ways to trigger an export:
- Right-click the active editor → TreePress: Export to PDF
- Command Palette (
Ctrl+Shift+P / Cmd+Shift+P) →
type TreePress: Export to PDF
- Keyboard shortcut
Ctrl+Shift+Alt+E (same on macOS)
For access to export options before rendering, use
TreePress: Export to PDF with Options — available via the same methods.
The export flow:
- TreePress renders the file and opens a PDF preview panel.
- Use the page number input or the
» button in the preview toolbar to
navigate pages before downloading.
- Optionally open the options sidebar to adjust settings and click
Adjust to re-render.
- Click Download to save, or Cancel to dismiss.
Export Options
| Option |
Description |
| Theme |
Use the active VS Code theme or select any installed theme |
| Force white background |
Override dark backgrounds for cleaner printing and sharing (disabled for light themes and visual exports such as HTML and images) |
| Font size |
Match your editor font size or choose 10 / 11 / 12 px |
| Line numbers |
Show or hide line numbers in the exported PDF |
| Page size |
Letter, A4, or Legal |
| Margins |
Normal (0.5 in), Narrow (0.25 in), or Wide (0.75 in) |
| Git footer stamp |
Print branch, commit, author, and date on every page |
Supported File Types
| File Type |
Extensions |
Export Mode |
| Source code |
Most languages (.ts, .py, .rs, .go, …) |
Syntax-highlighted source |
| Web files |
.css, .scss, .sass, .less, .jsx, .tsx, .vue, .svelte |
Syntax-highlighted source |
| HTML |
.html, .htm |
Rendered webpage (page options only; theme and typography options not applicable) |
| JSON / YAML / TOML / XML |
.json, .yaml, .toml, .xml |
Syntax-highlighted source |
| CSV / TSV |
.csv, .tsv |
Styled table |
| Markdown |
.md, .markdown, .mdx |
Rendered document or syntax-highlighted source |
| Jupyter Notebooks |
.ipynb |
Rendered cells with outputs |
| Config / plain text |
.env, .txt, .ini, .conf, .log, … |
Syntax-highlighted source |
| Images |
.png, .jpg, .jpeg, .gif, .svg, .webp, .bmp |
Centred on page (page options only) |
Known Limitations
- Image viewer — right-click export is not available when an image is
open in VS Code's built-in image preview. Use the Command Palette or
keyboard shortcut instead.
- Notebook output cells — right-click export from a notebook output cell
is not available due to VS Code platform constraints. Trigger the export
from the Command Palette or keyboard shortcut while the notebook editor
is focused.
- Large files — files exceeding 15,000 lines cannot be exported in full.
Break the file into smaller parts, or open a specific function or section
in a new editor window and export that instead.
License
MIT
| |