yunmin2 downloadsKeep the current reading palette in native PDF exports. 保留原生 PDF 导出,并沿用当前阅读配色。
Preserve the active Obsidian palette in native PDF export, with configurable spacing repeated on every page. Desktop only. By yunmin311.
Download · Changelog · Validation
Download main.js and manifest.json from a Release. Create .obsidian/plugins/native-pdf-theme-bridge/ inside your vault, put both files there, restart Obsidian, then enable Native PDF Theme Bridge under Community plugins. For upgrades, replace these two files only; preserve data.json. This plugin is not currently listed in the community catalog.
Use the normal Export to PDF command. No system print dialog or replacement export command is added. Open the plugin's settings tab to configure:
| Setting | Default | Behavior |
|---|---|---|
| Follow current palette | On | Use Obsidian's active light/dark palette, independently of the OS scheme |
| Per-page spacing | On | Repeat content padding on every page while leaving paper full-bleed |
| Top / right / bottom / left | 12 mm each | Independently adjustable, 0–40 mm |
For full-bleed textures, select Margins: None in the native export dialog. Obsidian remembers this per vault; the plugin does not change export preferences. Native page margins clip full-bleed backgrounds and cannot be undone by CSS. Textures and fonts are supplied by your theme/snippets, not bundled here.
data.json.450mm signature has its OS-color queries adjusted only in the export copy. Original snippets are untouched.为 Obsidian 原生「导出为 PDF」保留当前浅深色配色,并在每一页重复正文留白。作者:yunmin311。不调用系统打印窗口,不另造导出流程。
从 Release 下载 main.js、manifest.json,放进仓库的 .obsidian/plugins/native-pdf-theme-bridge/,重启并在第三方插件中启用。升级只替换这两个文件,保留自己的 data.json。目前尚未进入社区插件市场。
| 设置 | 默认值 | 作用 |
|---|---|---|
| 跟随当前配色 | 开启 | 使用 Obsidian 当前浅深色,而非操作系统配色 |
| 逐页留白 | 开启 | 每页重复正文内边距,纸纹仍可铺满纸面 |
| 上 / 右 / 下 / 左 | 各 12 mm | 四边独立调整,范围 0–40 mm |
在原生导出弹窗选择一次「页边距:无」,Obsidian 会记住。插件不擅自修改导出偏好;原生页边距产生的背景裁剪无法靠 CSS 撤销。纸纹和字体仍由主题、片段提供。
已用上述真实 Windows 环境验证 A4/A5 浅深色长文、代码与表格;逐页留白需 Chromium 130+,旧内核将保留原分页并提示更新安装程序。其他主题、横向、超大图片/代码、第三方动态嵌入仍需单独验证。不修改笔记、其他插件和原片段,不联网;关闭本插件即可回到原生行为。详细证据见 验证记录。
Node.js 20+, Poppler (pdftotext, pdftoppm) and Playwright Chromium are required:
npm ci
npx playwright install --with-deps chromium
npm test
Tests cover ordinary-document isolation, palette combinations, resource-safe probes, failure cleanup, settings persistence, independent toggles, old-engine fallback and actual Chromium A4/A5 PDF pagination. Runtime Obsidian exports supplement, not replace, those tests.
When reporting a problem, include application and installer versions, OS, theme, export paper size/margins and a minimal non-private Markdown sample. Do not upload your private vault or fonts.