An Obsidian plugin designed to export individual notes or entire folders of Markdown notes into PDF files directly on mobile and desktop devices.
- / 100% / +, Ctrl + scroll, or pinch-to-zoom), track live page/time progress, stop an in-flight preview render, and reload the PDF preview before generating.↑ / ↓ arrow buttons and a ≡ hamburger drag-and-drop handle on both desktop and mobile touch, quick Asc / Desc alphabetical sorting, automatic page breaks between notes, each note as a top-level chapter in the PDF outline and Page 1 index, unified page numbering, per-note footnote {title}, and clickable cross-note links).Queue (N): Next → ...) with a one-click Clear button (and a Clear queued PDF exports command in the Command Palette), while Stop cancels only the active job and advances to the next queued job.A4, Letter, A5), Orientation (Portrait / Landscape), Auto-Landscape Wide Pages (enabled by default in Portrait mode: automatically promotes the current page to Landscape in place when existing content and a wide block fit together cleanly—or starts a fresh Landscape page when needed—packs following content onto any remaining vertical space on that Landscape page, hides horizontal scrollbars, and automatically steps Content Scale down in 5% increments if ultra-wide content still overflows Landscape width before returning to Portrait on the next page), Margins (Narrow 10 mm, Normal 15 mm, Wide 25 mm, or Custom 5–45 mm), and Content Scale (80%–120%)..ttf) font directly from your vault (with live multi-word .ttf path autocomplete).Show Properties (Frontmatter)).Show Header, Header Template, Header Date Format, Header Time Format) and Footnote (Show Footnote, Footnote Template, Footnote Date Format, Footnote Time Format) independently on every page using {title}, {page}, {total}, {date}, {time}, {date:FMT}, and {time:FMT} tokens with full Unicode/emoji support.Optimize PDF Size (Smart Compression)):.webp and keeping the original whenever WebP would be larger)./FlateDecode (PNG) and /DCTDecode (JPEG) rather than WebP, every rendered page canvas is automatically encoded with the smallest sharp PDF-native format: 100% lossless 8-bit Indexed-Palette PNG (colorType = 3, 1 byte/pixel, ~2×–3× smaller with zero blur) for text/heading/table pages with ≤256 colors, and high-fidelity 93% JPEG at 2× HiDPI whenever it yields substantial savings on photos, Mermaid diagrams, callouts, or colorful/emoji pages—guaranteed never larger than standard 24-bit PNG while preserving the full selectable text layer.obsidian://mobile-pdf-export URI handler, queued export-job.json files (with incremental export-result.json checkpointing and automatic resume), and the included zero-dependency obsidian-pdf-cli.mjs CLI wrapper.cssclasses.![[image.png]]) with custom widths, preserves captions rendered by your active theme, CSS snippets, or caption plugins, cleanly exports community image carousels (hiding interactive left/right navigation arrows while preserving bottom slide indicator pills), and automatically scales very tall images proportionally (down to a 45% legibility floor) to fit cleanly on a single page instead of slicing them in half.$...$) and block ($$...$$) math expressions with bundled MathJax font loading on mobile, auto-fit scaling for wide display equations, and single-piece continuous vector square-root radicals (\sqrt{...}) so the diagonal and horizontal bar align seamlessly (including inside fractions, tall display roots, nested roots, and nth roots), as well as Mermaid diagrams (with proportional single-page height fitting for tall vertical diagrams down to a 45% legibility floor).<!-- pagebreak --> markers directly inside any note (honored in previews, single-note exports, and recursive folder exports) using the Insert page break at cursor or Copy page break syntax to clipboard commands, or set manual 1-based line numbers in the sidebar (with incremental preview caching). Optionally display accurate editor line numbers in the preview across paragraphs, headings, every list item (including indented continuation lines and nested/split lists), table rows, callout lists, and footnotes.H1–H6) appear in the outline and Page 1 index via a compact horizontal checkbox bar in both the sidebar and plugin settings.https://, http://, mailto:, tel:, ftp://) and internal same-note links (heading links [[#Heading]], anchor links [text](#section), and numeric footnotes [^1] / #fn-1 / #fnref-1) with accurate multi-line hit areas; when Clickable Links is disabled, links render as plain unhighlighted text and bare URLs are prevented from being auto-linked by PDF viewers.MarkdownView). This allows your active theme, CSS snippets, and standard Reading Mode community plugins to run natively.A4, Letter, A5), orientation, margins, and content scale, honoring inline <!-- pagebreak --> markers and sidebar page-break line numbers, splitting long lists, tables, code blocks, and callouts across page boundaries when needed, and optionally rotating individual wide pages (wide tables, horizontal diagrams, panoramic images, wide equations) to Landscape while keeping their preceding section heading attached.<foreignObject> engine with automatic html2canvas fallback), overlaid with a compressed invisible PDF text layer aligned to exact DOM line coordinates so text remains selectable and searchable (Ctrl+F)—including full non-Latin, RTL, and mixed-script Unicode (Latin Extended, Greek, Cyrillic, Chinese/Japanese/Korean, Arabic, Hebrew with UAX #9 bidirectional ordering for single-copy LTR+RTL lines, math symbols, and emojis)—enriched with hierarchical PDF bookmarks and clickable link annotations, and assembled into a PDF file (jsPDF) saved directly inside your vault.Because PDF generation runs locally via Reading Mode and canvas capture, please keep the following in mind:
PDF generation runs 100% locally on your device. This plugin collects no telemetry, analytics, or personal data, and never contacts any external backend or third-party server of its own.
If an automated plugin scanner or directory listing flags network API calls (requestUrl, XMLHttpRequest, or fetch) inside the bundled main.js, they exist solely for the following reasons:
XMLHttpRequest): Used exclusively on local origins (localhost, app://, capacitor://, blob:) to read bundled Obsidian/Capacitor resources—such as MathJax .woff2 math fonts and local vault assets—so they can be embedded cleanly during offline PDF rendering.requestUrl): Called via Obsidian's built-in requestUrl API only if a note you export explicitly embeds external http:// or https:// images, CSS background URLs, or web fonts that need to be drawn into the PDF. When exporting notes with purely local content, zero outbound internet requests are made.html2canvas & jsPDF): The remaining static occurrences of XMLHttpRequest / fetch reported in main.js come from the standard internal image/resource loaders inside html2canvas and jsPDF bundled into the plugin.To keep single-note previews, long multi-page documents, and recursive folder exports fast and stable on both desktop PCs and mobile devices—without changing export fidelity—the plugin uses several optimizations:
<foreignObject> Rasterizer (with Automatic Fallback): Renders each paginated Reading Mode page directly through the browser's native C++ Blink/Skia text & emoji layout engine with compact diff-only computed styles, session-cached inlined @font-face rules, vector checkboxes, continuous vector MathJax radicals, MathJax <defs> inlining, and automatic stripping of interactive UI controls (such as copy-code buttons and carousel arrows). Pages containing incompatible embeds (such as <iframe> or un-slotted external images) or WebViews that block <foreignObject> fall back seamlessly to memory-safe batched html2canvas.3 Tr + Tz horizontal alignment) over each page. Pure Western-Latin spans use built-in Helvetica with zero extra font overhead; whenever a span contains non-Latin, extended-Latin, RTL, math, emoji, or mixed-script characters, the plugin dynamically subsets a compact GlyphLess Type 0 (Identity-H + /ToUnicode UTF-16BE CMap) font containing only the unique characters used in the note (~1–4 KB total, 100% offline). Lines containing RTL scripts (Arabic, Hebrew, etc.)—alone or mixed with LTR text and numbers—are split into directional UAX #9 runs positioned visually but emitted in logical reading order so a single copy-paste preserves exact word and character direction across PDF viewers.jsPDF: Captures pages onto opaque (alpha: false) canvases so Chromium emits 24-bit RGB PNGs (colorType = 2), allowing jsPDF to embed the compressed IDAT stream directly instead of decoding and re-deflating RGBA pixels in JavaScript.MessageChannel) & Live Progress: Uses MessageChannel yields whenever document.visibilityState === 'hidden' (avoiding Chromium's 1-second background setTimeout throttling on desktop when switching windows) and timer-backed frame yields in foreground, displaying live page progress (page/total) in both the sidebar timer and export notice. (Note: On mobile Android/iOS, the OS freezes background WebViews, so Obsidian must remain in the foreground until the export completes.)high / medium / low tiers) to scale parallel image prefetch concurrency, fallback batch limits, inter-page yields on long notes, and dynamic cooldown pauses between notes during recursive folder exports so lower-power PCs and mobile devices stay responsive..ttf fonts are read and Base64-encoded once per (path, mtime).Blob URLs and composited directly onto page canvases, block heights are pre-measured in a single pass, and notes without async widgets (Mermaid, Dataview, MathJax, embeds, custom code blocks) use a fast adaptive settle window.IntersectionObserver, reducing startup latency and memory usage on long documents.main.js, manifest.json, and styles.css.markdown-to-pdf-mobile in your vault's .obsidian/plugins/ directory.1.3.5 or newer).Ctrl/Cmd + P) and run: BRAT: Plugins: Add a beta plugin for testing (with or without version).https://github.com/ALE-ARME/markdown-to-pdf-mobile.Latest version.file-down) or the Command Palette (Open PDF settings sidebar).<!-- pagebreak -->)You can force a page break directly inside any Markdown note by placing <!-- pagebreak --> on its own line (ignored inside fenced code blocks and %% comments, and honored in previews, single-note exports, and recursive folder exports):
<!-- pagebreak --> cleanly at the current editor cursor position.<!-- pagebreak --> to your clipboard on desktop, Android, and iOS so you can paste multiple breaks quickly.You can export all Markdown notes inside a folder (and all its subfolders) in one batch, with a live progress bar, elapsed timer, per-page progress, and a Stop button (stopping cleanly aborts the current note while keeping all already-saved PDF files):
Combine a folder or a custom ordered list of notes into one PDF document, with automatic page breaks between notes, each note as a top-level chapter in the PDF Document Outline (with its headings nested underneath) and Page 1 Table of Contents, unified {page} / {total} numbering, per-note {title} footnotes, clickable cross-note links, and a Stop button:
Choosing & Reordering Notes in the Merge Dialog:
↑ / ↓) first, for precise step-by-step moving.≡) right next to the arrows, for smooth drag-and-drop reordering on both desktop (mouse) and mobile (touch).Asc or Desc, remove unwanted notes (×), expand Add more notes from vault to append extra notes, and customize the output PDF filename and destination folder before clicking Export merged PDF.Destination behavior (configured in Settings → Community Plugins → Markdown to PDF Mobile):
<!-- pagebreak --> markers inside each note are respected).Exports/PDFs, or / for the vault root), creates a subfolder with the same name as the exported folder inside that path and mirrors its subfolder structure; if empty, creates a sibling <FolderName> (PDF) folder.<FolderName>.pdf inside Folder Export Path if set, or next to the original folder if left empty..md files are skipped automatically.You do not need to wait for an export or preview to finish before starting the next one:
Queued (#1): ...).Queued (#N)... and renders automatically when its turn arrives (newer preview refreshes replace any stale waiting preview in place so you never wait on outdated notes).Automate single-note, recursive folder, and multi-note merged PDF exports from scripts, terminals, or AI coding agents without touching the UI:
obsidian-pdf-cli.mjs):
Works on Linux, macOS, Windows, and Android Termux (Node.js 18+). It writes .obsidian/plugins/markdown-to-pdf-mobile/export-job.json, triggers obsidian://mobile-pdf-export, polls export-result.json, and prints human-readable or --json output:# Single note
node obsidian-pdf-cli.mjs --vault "/path/to/Vault" --note "Biology/Cells.md" --out "PDFs"
# Recursive folder export (separate PDFs)
node obsidian-pdf-cli.mjs --vault "/path/to/Vault" --folder "Biology" --out "PDFs"
# Merge folder into one PDF with header, frontmatter & dark theme
node obsidian-pdf-cli.mjs --vault "/path/to/Vault" --folder "Biology" --merged --name "Biology Book" --header "{title} - {page}/{total}" --frontmatter true --theme dark
# Merge specific notes in exact order (machine-readable output for AI agents)
node obsidian-pdf-cli.mjs --vault "/path/to/Vault" --merge "Intro.md,Ch1.md,Ch2.md" --name "Course" --json
obsidian://mobile-pdf-export):
Works from desktop terminals (xdg-open / open / start), Android Termux (termux-open-url / am start), and iOS Shortcuts (Open URL action):obsidian://mobile-pdf-export?vault=MyVault¬e=Biology/Cells.md&out=PDFs&theme=dark&frontmatter=true&header=true
obsidian://mobile-pdf-export?vault=MyVault&folder=Biology&mode=merged&name=BiologyBook&out=PDFs
obsidian://mobile-pdf-export?vault=MyVault¬es=Intro.md,Ch1.md,Ch2.md&name=Combined&out=PDFs
obsidian://mobile-pdf-export?vault=MyVault&job=default
export-job.json → export-result.json):.obsidian/plugins/markdown-to-pdf-mobile/export-job.json (combining any mix of note, folder, and merge tasks with temporary options overrides that never overwrite your saved settings).export-result.json after every task.export-job.json (while preserving export-result.json for CLI/agent polling) so running queued jobs again or restarting Obsidian will never accidentally re-run a completed export. If a job is manually cancelled mid-run, export-job.json is kept so it can be resumed later.skills/obsidian-pdf-export/):skills/obsidian-pdf-export/SKILL.md and a standalone skills/obsidian-pdf-export/pdf-export-settings.json configuration file kept completely separate from the plugin's data.json.pdf-export-settings.json before every export (applying all 24 supported options via --job-file) and update that file whenever you ask to change default CLI export preferences.PDF-Export-Test-Suite.md)Copy PDF-Export-Test-Suite.md into your vault to verify frontmatter + immediate callout rendering, title spacing, H1–H6 hierarchy, numbered lists with indented continuation lines & unindented column-0 text, compact/wide/ultra-wide/multi-page tables, code blocks, LaTeX math, Mermaid diagrams, large & panoramic images, manual page breaks, links/footnotes, and Unicode/BiDi/emoji text selection in a single export.
When enabling Show Header and/or Show Footnote, each section provides its own independent Template, Date Format, and Time Format dropdowns (Year-first, Day-first, Month-first, 12h AM/PM or am/pm, 24h, with or without seconds).
| Variable | Description | Example |
|---|---|---|
{title} |
The title (filename) of the current note | My Note |
{date} |
The current date using the selected Header / Footnote Date Format | 2026-01-21 |
{time} |
The current time using the selected Header / Footnote Time Format | 14:05 |
{page} |
The current page number | 1 |
{total} |
The total number of pages in the PDF | 5 |
{date:FORMAT} |
Custom date/time format | 21/01/26 |
{time:FORMAT} |
Custom time format | 02:05:30 PM |
{date:FORMAT} / {time:FORMAT})Uses Moment.js syntax. (Note: Months and days render in English.)
| Unit | Format | Example (Jan 9, 2026) | Description |
|---|---|---|---|
| Year | YYYY / YY |
2026 / 26 |
Full / 2-digit year |
| Month | MMMM / MMM |
January / Jan |
Full / Short name |
MM / M |
01 / 1 |
Padded / Simple number | |
| Day | DD / D |
09 / 9 |
Padded / Simple day |
dddd / ddd |
Friday / Fri |
Full / Short day name | |
| Hour | HH / h |
14 / 2 |
24h / 12h format (14:00 vs 2 PM) |
| Minute | mm / m |
05 / 5 |
Padded / Simple minutes |
| AM/PM | A / a |
PM / pm |
Uppercase / Lowercase |
Example Template: {title} - Page {page} of {total} | {date:DD/MM/YYYY}
To build the plugin locally (reproducible install via package-lock.json):
npm ci
npm run build
This generates the main.js bundle required (alongside manifest.json and styles.css) for Obsidian to load the plugin. Pushing a version tag matching manifest.json (or running the workflow manually from GitHub Actions) triggers .github/workflows/release.yml to type-check, build main.js, and publish the GitHub Release artifacts automatically.
The plugin was entirely made by Gemini models