Better Export PDF Mobile

unlisted

by Anish Goyal

Export notes to PDF on iPad, Android and desktop without Electron: paginated preview, outline, header/footer, clickable links and metadata.

★ 1 starsUpdated 15d agoMIT
View on GitHub

Better Export PDF Mobile

(important note... this repo has been picking up popularity but I really only meant for it to be used in my personal workflow, hence the AI generated slop. if there is genuine interest in having this as an obsidian community plugin, I can make it significantly better because right now, to put it bluntly, it kinda sucks.)

An Obsidian plugin that exports notes to PDF without Electron, so it runs on iPadOS and Android as well as on desktop. It is a from-scratch rewrite of Better Export PDF with feature parity, using a browser-only pipeline:

note(s) → render (MarkdownRenderer) → anchors → paginate (own paginator)
        → rasterize (SVG foreignObject, html2canvas fallback)
        → assemble PDF (pdf-lib: image pages, invisible text layer, links, outline, metadata)
        → save into the vault → open

Features

  • Export the current note, a whole folder merged into one PDF, or one PDF per note in a folder.
  • TOC-driven exports (toc: true frontmatter, order = links in the note) and a "Generate TOC.md" helper.
  • Paginated preview that matches the output; page sizes A0–A6, Legal, Letter, Tabloid, Ledger, Custom (mm); margins None/Default/Small/Custom; scale 10–200 %; landscape.
  • Header and footer HTML templates with Chromium's contract (.date, .title, .url, .pageNumber, .totalPages, {{frontmatterKey}}), overridable per note.
  • Outline/bookmarks from headings, clickable internal links (headings, block ids, cross-note links in merged exports) and external links, PDF metadata from frontmatter.
  • Invisible text layer so text is selectable, searchable and copyable.
  • Repeated table headers on continued pages, callouts and headings kept together.
  • Apply a disabled CSS snippet to an export, optional timestamp suffix, collision-safe file names, "open after export".
  • Settings import automatically from the original plugin on first load.

Not available: tagged (accessible) PDF and vector text. Pages are rasterized (3× CSS px ≈ 288 dpi by default) with a text layer on top.

Install (local plugin)

  1. npm install && npm run build → main.js, styles.css, manifest.json.
  2. Copy the three files into <vault>/.obsidian/plugins/better-export-pdf-mobile/ (and into every other config folder the vault uses, e.g. .obsidian-mobile/).
  3. Enable Better Export PDF Mobile in Settings → Community plugins. Restricted mode must be off. On mobile, force-quit and reopen Obsidian after copying a new main.js.

Development

  • npm run dev watches and rebuilds.
  • node test/run.mjs <dir-with-playwright> builds a browser harness for the engine (paginate → rasterize → pdf) and writes PDFs and screenshots to test/out/ for inspection with pdfinfo, pdftotext, qpdf.
  • npm run font regenerates the Noto Sans subset used by the text layer.

License

MIT. Copied code from Better Export PDF (MIT, l1xnan) and marp-cli (MIT); Noto Sans under the SIL OFL. See THIRD_PARTY_LICENSES.md.

For plugin developers

Search results and similarity scores are powered by semantic analysis of your plugin's README. If your plugin isn't appearing for searches you'd expect, try updating your README to clearly describe your plugin's purpose, features, and use cases.