Single Page PDF Export

by IO
5
4
3
2
1
Score: 50/100

Description

Export obsidian notes as single-page PDF without page breaks. Height is auto-calculated from content.

Reviews

No reviews yet.

Stats

1
stars
87
downloads
0
forks
9
days
4
days
4
days
0
total PRs
0
open PRs
0
closed PRs
0
merged PRs
1
total issues
0
open issues
1
closed issues
11
commits

Latest Version

4 days ago

Changelog

  • Fix preview scrolling: wheel events never reach the embedder reliably (e.g. Windows at 100% scaling swallows webview wheel input), so the guest page now scrolls natively inside a viewport-sized webview, with a manual scrollBy wheel handler in the guest and a document-level capture fallback in the embedder
  • Restore full content height before printToPDF so export output is unchanged by the preview sizing
  • Settings: implement the declarative settings API (Obsidian 1.13+) with a render hook preserving the width slider and A1-A6 presets; keep display() as the fallback for older versions
  • Cap dialog width at min(70vw, 1400px) to suit both 1080p and 4K setups

README file from

Github

Single Page PDF Export

中文文档

An Obsidian plugin that exports notes as a single-page PDF without page breaks. The page height is automatically calculated based on content — no manual configuration needed.

Features

  • Single-page PDF: No page breaks, entire document on one continuous page
  • Auto-calculated height: Content height measured automatically at A4 width
  • Preview: See the rendered content before exporting
  • User fonts: Respects your Obsidian font settings
  • i18n: English and Chinese (Simplified) supported
  • Context menu: Right-click a file to export directly

Installation

From Community Plugins

  1. Open Obsidian → Settings → Community Plugins
  2. Click Browse and search for "Single Page PDF"
  3. Click Install, then Enable

Manual

  1. Download main.js, manifest.json, styles.css from Releases
  2. Copy to <vault>/.obsidian/plugins/single-page-pdf/
  3. Enable in Settings → Community Plugins

Usage

Command Palette

  1. Open the markdown file you want to export
  2. Ctrl+P → type "Single Page PDF"
  3. Preview opens → click "Export PDF"

File Menu

  1. Right-click a .md file in the file explorer
  2. Select "Export to single-page PDF"

Build

npm install
npm run build

Output is in the dist/ folder.

Development

npm run dev

Watches for changes and rebuilds automatically.

How It Works

  1. Renders markdown using Obsidian's MarkdownRenderer
  2. Injects the rendered HTML into a <webview> at A4 width (794px)
  3. Measures scrollHeight to get actual content height
  4. Scales the preview to fit the container
  5. Calls webview.printToPDF() with custom page size (A4 width × content height)

Supported Languages

Locale Language
en English
zh-cn 简体中文

To add a new language, create src/i18n/<locale>.ts and register it in src/i18n/index.ts.

License

MIT