FleurPDF

by JC5
5
4
3
2
1
Score: 52/100

Description

The FleurPDF plugin adds PDF highlighting, underlining and comments with text selection tuned for Chinese and other CJK content. Highlights appear at the selected position and can use custom colours, while underlines support solid, dashed, dotted or wavy styles. A sidebar lists annotations for inline editing, deletion and export to a note organised by PDF page number. Optional AI actions can explain selected passages, translate between Chinese and English, answer questions and generate annotations for highlights through DeepSeek, OpenAI or another OpenAI compatible API. Provider settings include an API key and custom base URL, with the key stored locally except when API calls are made. Text selection can fail while the PDF text layer is loading or when a selection crosses multiple pages.

Reviews

No reviews yet.

Stats

2
stars
2,090
downloads
0
forks
96
days
1
days
1
days
0
total PRs
0
open PRs
0
closed PRs
0
merged PRs
0
total issues
0
open issues
0
closed issues
115
commits

Latest Version

2 days ago

Changelog

1.9.2 — 修复跨 PDF 串批注/串便签 + 贴便签不再跳页

  • 批注与便签的本地 sidecar 文件名改用 64 位稳定哈希(djb2 + FNV-1a),不再把中文、空格、标点一律塌成下划线。此前同目录下「等长中文书名」的不同 PDF 会落到同一份 json,表现为打开新 PDF 时侧栏批注总览出现另一本书的批注、继续批注还会混在一起
  • 读取时校验归属(fileId / file 必须精确等于当前 PDF 路径),归属不符一律按空处理;旧版有损键文件在首次打开时按归属精确匹配做一次性迁移,撞键共享的旧文件不认领、不删除
  • 顺手修复便签:新建便签按「当前可见区域」中心定位(不再按整页中心)、聚焦时 preventScroll 并回滚一帧滚动;PDF 开在弹出窗(popout)时按真实滚动容器计算可见页,修掉「贴便条时页面跳一下 / 跳到第一页」

隐私:本版本没有新增任何数据采集、日志或网络行为。sidecar 仍只落在本机插件配置目录,文件名是哈希、不含书名;迁移只发生在本机文件系统内,不上传任何内容。

1.9.1 — 社区审核 lint 合规修复(零功能变化)

  • no-static-styles-assignment:直尺宿主的 position: relative 写入与卸载恢复、直尺刻度层的四条 background(image / size / repeat / position)由直写 el.style.* 改走 Obsidian 推荐的 setCssStyles。行为完全一致(同一份行内样式),深浅色主题、直尺拖拽/旋转/刻度渲染均不受影响。

隐私:本版本没有新增任何数据采集、日志或网络行为。

1.9.0 — 笔盒形状工具:矩形 / 圆形 / 直线 + 画后选中拖移

  • 笔盒新增「形状」工具:拖拽画出矩形、圆形或直线,形状三选一在弹层里切换;直线模式下填充色板自动隐藏
  • 矩形与圆形支持半透明荧光笔式填充(默认荧光黄 45% 透明度),色板五色 + 「无填充」描边圆环;弹层两段式布局(形状三选 + 分隔线 + 填充色板),激活项用主题强调色高亮
  • 画后选中拖移:点一下已画形状即选中(蓝色虚线框),在框内拖动整体平移;选区在工具切换时清除
  • 形状描边默认粗细 1(与钢笔最细档一致),颜色/粗细在形状模式激活时通过笔盒常规按钮独立调整,不干扰当前笔
  • 形状数据走 sanitize 白名单(shape/fill 字段跨端同步与序列化往返不丢失),橡皮碰轮廓整条删、套索整体圈选、撤销 / 同步 / 导出全部按普通笔迹处理

隐私:本版本没有新增任何数据采集、日志或网络行为。形状工具完全离线,所有数据仅存本地 sidecar。

1.8.3 — 批注气泡编辑/删除 + 显隐开关 + 删除防复活兜底(桌面 + 平板)

  • 批注气泡新增编辑与删除:弹卡右上角两枚小操作钮(桌面端悬停弹卡才显形,平板点开弹卡即显示);删除走标注 id 精确移除,编辑弹窗回填原文引用与批注内容,保存后气泡原位重建、侧边栏同步刷新
  • 气泡造型重制:图标改为无底色 message-square 线条样式(半透明、悬停变实),弹卡底色改用主题变量(--background-secondary + 主题边框),深浅色主题自动适配,不再有半透明紫底叠加变深的问题
  • 弹卡文字排版:仅首行右侧让位给操作钮(浮动占位),第二行起恢复全宽,长批注不再被整列留白挤窄
  • 设置新增「PDF 页内显示批注气泡」开关(默认开 = 现状):关闭后页内气泡隐藏,标注数据与侧边栏不受影响,桌面端与移动端一致
  • 气泡闪烁修复:恢复流程重复执行时按标注 id 幂等去重,不再叠出多层气泡与半透明加深
  • 删除防复活兜底:删除成功后记会话内墓碑,恢复流程跳过已删 id 并把净化后的数据写回——杜绝在途写入回写或同步拉回旧版导致的「删了又回来」;删除后全文档清扫孤儿气泡(含锚点页与标注页不一致的漏网)
  • 「高亮不见」三重兜底:读到 0 条但会话内已知非空时延迟复查(sidecar 同步时序);恢复被冲掉后按 DOM 变更自愈重放;文本匹配新增去标点/规范化第六策略(唯一命中时按映射表还原位置)
  • 桌面端手写模式(desktopInk)下的文本批注菜单回归桌面款(右键近点弹出);底部居中弹出仅真机移动端;移动款菜单样式改挂真机 body 类,桌面端图标不再叠压
  • 设置「默认打开侧边栏」接线生效:关闭后打开 PDF 不再自动弹出批注侧边栏
  • 侧边栏顶栏改为随批注列表滚动;顶栏新增「回到顶部」按钮,列表滚过一屏后右下角浮现回顶圆钮
  • README 网络声明措辞精确化:内置词典源(有道词典 / dictionaryapi.dev)与钥匙串存储说明

隐私:本版本没有新增任何数据采集、日志或网络行为。删除墓碑仅存于会话内存(24 小时过期),不落盘、不上传;气泡显隐与回顶等新功能全部离线。

1.8.2 — 便签与手写模式修复(桌面 + 平板)

  • 手写批注模式下便签用鼠标可正常操作:输入、拖拽、缩放、折叠全部恢复;笔/触摸不受影响,仍穿过便签落墨与滚动
  • 折叠便签摘要统一固定宽度(约 8 个字,超出以省略号截断),一排脚注整齐划一
  • 折叠态隐藏 × 删除按钮,展开后才显现,小脚注上不再误删
  • 修复折叠便签右侧拖不动的问题(拖拽边界改按实际渲染宽度计算)
  • 重开文档时折叠便签摘要即时显示,不再空白
  • 导出的便签笔记去掉重复主标题(文件名即标题,正文不再另写 H1)

隐私:本版本没有新增任何数据采集、日志或网络行为,便签数据只存在本地 sidecar 与你指定的导出文件中。

1.8.1 — 通过社区审核 lint 的合规修复(零功能变化)

① no-static-styles-assignment:便签折叠态的 width:auto / height:22px 从 JS 直写 el.style 移入 .fleur-pdf-note.is-collapsed CSS 规则;行内几何(left/top/展开宽高)统一经 Obsidian 推荐的 setCssStyles 设置。折叠/展开、拖拽、缩放行为与 1.8.0 完全一致。

② no-console:patcher.ts / ink-ui.ts 共 8 处诊断日志由 console.log 改为 console.debug(Obsidian 插件指南仅豁免 warn/error/debug)。真机排查时控制台筛选 debug 级别即可,输出内容一字未改。

隐私:本版本没有新增任何数据采集、日志或网络行为。

1.8.0 — 三项新功能(均可选开启,默认关闭不影响现有用户)

① PDF 页面便签(设置 →「便签」开启) 可在 PDF 页面上贴 draggable/resizable 的便签:拖动、缩放、折叠成小脚注条,底色与字号可在设置里自定义(底色自动配对比文字色)。一键把所有便签导出为 Markdown 笔记,再次导出覆盖上一次的笔记。便签数据只存在本地 sidecar 文件(.obsidian/plugins/fleur-pdf/data/,文件名是路径哈希,不含任何原始路径或笔记标题),导出目标由你在保存对话框里选择。

② 手写笔盒 / 模式切换胶囊可折叠 笔盒末端新增折叠按钮,收起后变成一枚跟随当前笔色的圆钮;模式切换胶囊同样改为把手拖拽 + 「»」显式折叠按钮(替代旧的长按折叠,更直观)。折叠状态跨会话记住。

③ 浮动 UI 只作用于当前 PDF 窗格 反馈改进:笔盒、切换胶囊、便签工具此前挂在 window 全局,多窗格时体验差。现在它们钉在当前焦点 PDF 窗格内,随窗格移动/缩放;焦点离开 PDF 时隐藏,手写模式与未保存笔迹原样保留,回到 PDF 窗格即恢复。

隐私:本版本没有新增任何数据采集、日志或网络行为。便签功能完全本地——无网络请求、无遥测,sidecar 文件名使用哈希而非原始路径;导出笔记内容仅写入你指定位置。

1.7.17 — 设置页精简:移除「归并窗口 / 归并距离」两个数值项

真机反馈设置页冗余:「智能抬笔归并」下方的「归并窗口(毫秒)」与「归并距离(像素)」两个数值项从设置页移除,只保留总开关(它是判定层出问题时的用户侧退路,必须留着)。引擎行为零变化——仍读取 data.json 里的 inkGhostWindowMs / inkGhostNearPx,老用户改过的自定义值继续生效,没改过就走默认 150 / 96,只是不再提供 UI 入口。

隐私:本版本没有新增任何数据采集、日志或网络行为。

1.7.16 — 移动端手写批注整体回退到 1.7.10

真机反馈 1.7.11 以来的断触修复线(悬停续写判据、宽限期悬停采样不校验指针 ID、「离开感应区」标记撤销、归并封顶放宽到 8)在实机上反而让断触更严重,按用户决定把移动端手写批注的判定与引擎整体回退到 1.7.10 状态:grace-merge.ts、overlay-engine.ts、settings.ts 三个文件与 1.7.10 逐字节一致(设置页不再有「悬停续写窗」一项),ink-ui.ts 仅摘除对已移除设置项的传参。本轮所有文本模式改动(选区菜单底部居中、长按菜单一并走该通道、拖拽位置记忆)全部保留,未受影响。旧 data.json 里遗留的「悬停续写窗」数值会被静默忽略,无需手动清理。

隐私:本版本没有新增任何数据采集、日志或网络行为。

1.7.15 — 选区菜单记住你拖到的位置

真机反馈:底部居中的选区菜单可以拖走,但每次重新弹出都回到底部 —— 拖走是用户对「我想让它待在哪」的直接表达,应该被记住。现在拖拽把手松手后记下落点,之后每次弹出(含选区变化重建的面板)都落在那个位置并夹紧当前视口(旋转、分屏后不会丢到屏幕外);没拖过仍维持 1.7.12 的屏幕底部居中。记忆是会话级的:存在插件实例内存里,不写 data.json —— 面板是临时 UI,重启后回默认位置,这个行为不产生任何持久化数据。桌面端面板 DOM 与交互不变。

隐私:本版本没有新增任何数据采集、日志或网络行为;记忆位置只在内存里存活到插件重载,不落盘、不上传。

1.7.14 — 手写判定回退到 1.7.12

真机反馈 1.7.13 的手写体验不如上一版,按用户决定整体回退:1.7.13 对「悬停续写」判据的放宽(悬停证据可选化、无悬停时画直弦)已完全撤销,手写抬笔归并行为与 1.7.12 逐字节一致(源码 diff 为空)。1.7.12 的文本模式改动(长按选词菜单一并走底部居中通道、不再跳位)原样保留,本版本未做任何其他变更。

隐私:本版本没有新增任何数据采集、日志或网络行为。

1.7.12 — 选区菜单一处跳位修复:长按菜单并入选区自动通道

真机反馈:1.7.11 的「选区菜单底部居中」弹出后,菜单仍会先在选区旁出现一瞬再跳到底部。根因是长按选词时 WebView 会先派发 contextmenu 事件——旧代码把这条路径按「右键菜单」就近定位,约 300ms 后选区稳定判定又按自动通道弹一次底部居中,于是每次选词都跳一遍。修复:真机移动端把长按菜单并入选区自动唤起通道,同款底部居中定位、同款选区指纹去重,一次弹出不再跳位;同时登记指纹避免稳定判定重建面板造成的二次闪烁。桌面端右键近点弹出语义不变。

隐私:本版本没有新增任何数据采集、日志或网络行为。

1.7.11 — 断触的最后一块拼图:固件重编指针 ID + 悬停续写;切换器不再自动贴边;选区菜单底部弹出

断触修复(真机 1.7.10 采集定性):把判定函数打包后在 Node 里逐字节复刻引擎状态机、重放真机诊断里的 68 次抬笔重落,发现两个此前看不见的事实——这批固件在幽灵抬笔瞬间会把笔重编成新 pointerId(68 次里 30 次宽限窗内重落全部跳变),而宽限期的悬停采样此前按 pointerId 过滤,悬停轨迹整段被丢,1.7.10 的「直行穿隙」判据因此全灭;同一批固件还会在 pointerup 的同一毫秒发 pointerout(30/30),而悬停 move 明明还在继续——笔从未离开感应区,「离开感应区」判据却把这些重落当成了有意提笔。修复:宽限期悬停采样不再校验 pointerId(宽限期内不存在第二支正在接触的笔);悬停 move 到达即撤销「已离开感应区」标记——这也是 W3C Pointer Events 对支持悬停的笔的规范行为(up 之后不应立即 out)。判定函数新增第 ⑤ 条「悬停续写」:抬笔后 220ms 内、宽限窗里采到了悬停轨迹(digitizer 全程看得见这支笔,固件只是把接触签报丢了)且落点在近端,就判同一笔,并按真实悬停轨迹落墨——那是笔尖在空中实际走过的路,不是替用户画的弦。220 取自真机 dt 分布的双峰空档:幽灵重落全部 ≤168ms,有意提笔全部 ≥233ms。单笔归并封顶从 4 放宽到 8:同一批数据显示固件能在 850ms 里连丢 5 次接触签,旧封顶会在第 5 次重落留下残余断点,而每条归并通道现在都有物理证据门槛(①速度 / ④共线 / ⑤悬停轨迹),级联风险远低于 1.7.6 的无条件近端连线。设置新增「悬停续写窗(毫秒)」。离线重放真机数据 30/30 全部桥接,11 个输入探针全过(含 id 重编 + 方向反转的新场景);掌压拒止与手指滚动走的是另一条独立通道,本版本未触碰;「智能抬笔归并」总开关仍可一键回到 1.7.6 行为。

两处 UX(真机反馈):

  • 悬浮切换器(三段胶囊)不再在文本模式下自动贴边——贴边把手太小、点不中,弊大于利;需要让路时用长按收起(持久态,点把手恢复)自己表达。
  • 移动端选中文本弹出的批注菜单默认在屏幕底部居中弹出,不再贴着选区就近弹出压住正文与选择滑杆;拖拽把手仍可临时移开,面板随选区重建时回到底部。

隐私:本版本没有新增任何数据采集、日志或网络行为。悬停采样只在归并窗口的内存缓冲里存活几百毫秒,随判定消耗或清空,不落盘、不上传。

1.7.10 — 移动端手写「偶发断触」的几何补笔 + 文本批注模式不再挡路

偶发断触(真机 1.7.9 采集后定位):抬笔归并判定新增第 ④ 条「直行穿隙」。此前的 ①(运动中掉签)与 ②(急转)都默认笔在快速运动,而慢写实测末端速度只有 0.01~0.25px/ms —— ① 几乎永不触发,③(离开感应区)又把相当一部分正常续写判成有意提笔,这些落点最终全落在 gap(归并不落墨)上,用户看到的正是笔画中间偶发的洞。④ 不看速度、也不看感应区,只看「新落点是否落在抬笔前这一笔的延长线上、跳距是否很短、空中轨迹是否直」:这是唯一与书写快慢无关、又能把「同一笔被报丢」和「换一笔」分开的判据。三个参数取自同一批真机数据 —— 跳距上限 18px(万一错判,多画的那段最长就这么长)、转角上限 40°(救回的正例全在 38° 内,被排除的 34 次正常提笔全在 56° 以上,中间有清晰空档)、时间窗 220ms。出这个长窗之外,判定函数只允许 ④ 这一条落墨分支,其余一律按新笔画处理,所以放宽的只是「共线短跳」这一种情形的机会,不改变任何一条已有判据的边界。掌压拒止与手指滚动走的是另一条完全独立的通道,本版本未触碰;设置里的「抬笔归并」总开关仍可一键回到 1.7.6 行为。

文本批注模式的两处挡路修复:

  • 悬浮切换器(三段胶囊)在文本模式下闲置 2.6s 后自动贴边,收成一根侧边把手;点正文(含开始选字)即刻让路,点把手即恢复。手写模式下它是工具条(笔 / 橡皮 / 套索 / 列表),这套机制整个不生效。贴边是纯临时态,不写设置,与用户长按收起的持久态完全正交,不会把「临时」变成「永久」。
  • 选区批注面板在你继续拖动选择手柄、选区内容发生变化时立刻收走,而不是继续压在选区下方挡住手柄要去的地方;同时把下一轮弹出窗拉长到 1.4s,避免「收掉又闪回来」在手指底下闪成一片。一次都没被打断的正常选字仍按 600ms 稳定窗弹出,手感不变。

隐私:本版本没有新增任何数据采集、日志或网络行为。用于判断「选区还在变」的指纹只存在于内存字段,不落盘、不上传、不打印;手写诊断记录器仍是只能在命令面板手动开启的 opt-in 工具,数据只写本机 vault 的可见文件,不含 PDF 文字、文件名与账号信息,两个文件可随时整篇删除(详见 README 隐私说明)。

README file from

Github

FleurPDF

Smart PDF Reading and Annotation Plugin for Obsidian

中文文档


✨ Features

Why Choose FleurPDF Over Other PDF Plugins?

  1. Chinese-Friendly Design

    • Optimized text selection for Chinese characters
    • Proper handling of CJK text in PDFs
    • Smart text boundary detection
  2. WYSIWYG Highlights with AI Annotations

    • What you see is what you get - highlights appear exactly where you select
    • AI can automatically generate insightful annotations for highlighted text
    • Visual feedback is immediate and accurate
  3. AI-Powered Assistance

    • AI Explain: Get detailed explanations of selected text
    • AI Translation: Instant translation between Chinese and English
    • AI Annotations: Auto-generate thoughtful notes for your highlights
    • Supports any OpenAI-compatible API (DeepSeek, OpenAI, etc.)
  4. One-Click Note Export

    • Export all annotations and highlights to a new Obsidian note
    • Preserves page numbers and organization
    • Perfect for creating reading summaries
  5. Sticky Notes on PDF Pages (opt-in, v1.8.0)

    • Pin draggable, resizable, collapsible sticky notes anywhere on a PDF page
    • One click collects all notes into a single Markdown note; re-exporting overwrites the same note
    • Background color and font size are user-configurable
    • Fully local: content lives in a sidecar file under the plugin's data/ folder (hashed file name, no paths or note titles in it), and the exported note is an ordinary vault note

Complete Feature List

  • 📝 Highlighting: Yellow, blue, green, and customizable colors
  • 📏 Underlining: Solid, dashed, dotted, or wavy styles
  • 💬 Comments: Add personal notes to any text selection
  • 🤖 AI Features:
    • Explain complex passages
    • Translate text
    • Generate intelligent annotations
    • Interactive Q&A about selected content
  • 📊 Sidebar: View and manage all annotations in one place
  • 📤 Export: One-click export to Obsidian notes
  • 🎨 Customizable: Adjust colors, styles, and AI settings

📦 Installation

Manual Installation

  1. Download main.js, manifest.json, and styles.css from the latest release
  2. Create a folder <vault>/.obsidian/plugins/fleur-pdf/
  3. Place the three files into the folder
  4. Reload Obsidian
  5. Enable "FleurPDF" in Settings → Community plugins

Build from Source

git clone https://github.com/gibsonchan-5/fleur-pdf.git
cd fleur-pdf
npm install
npm run build

Then copy main.js, manifest.json, and styles.css to your vault's plugin folder.

🔧 Configuration

AI Setup

  1. Open Obsidian Settings → FleurPDF
  2. Choose your AI provider (DeepSeek, OpenAI, or Custom)
  3. Enter your API Key (stored locally only)
  4. Configure the Base URL if using a custom endpoint
  5. Click "Test Connection" to verify

Security Note: Your API Key is stored locally only — by default in Obsidian's system keychain (SecretStorage), not in data.json, so it never syncs with your vault (you can opt into plain data.json storage in settings). Keys are sent solely to the AI endpoint you configure. Apart from your configured AI endpoint and the built-in dictionary sources (Youdao Dictionary / dictionaryapi.dev, which receive only the word being looked up), the plugin sends nothing to any server and has no telemetry.

Annotation Settings

  • Default Highlight Color: Choose your preferred highlight color
  • Default Underline Style: Select solid, dashed, dotted, or wavy
  • Note Export Folder: Specify where exported notes should be saved
  • Sidebar Position: Choose left or right sidebar

Cross-Device Sync (optional, off by default)

Text annotations (highlights / underlines / comments / AI results) and stylus ink can each be synced between your devices. When enabled, the plugin keeps a visible copy per annotated PDF inside your vault — FleurPDF/data/annotations/ for text annotations, FleurPDF/data/ink/ for ink — which travels with whatever sync you already use (Remotely Save, iCloud, …). Files are merged read-merge-write when a PDF opens, after each save, and when a copy change is detected; edits resolve last-writer-wins by modification time, and deletions are recorded as tombstones so a stale copy on another device cannot resurrect deleted annotations. Enable the toggles on every device. The copies only ever live in your own vault — the plugin sends nothing anywhere and has no telemetry.

Mobile Handwriting (Ink) Annotations

Stylus ink is rendered on the plugin's own overlay canvases and persisted in a sidecar file under FleurPDF/data/ — it is never baked into your PDF, and it is only ever written to your own vault.

  • Ink display precision: rasterising and compositing the ink layer costs scale with the screen DPR, so on some tablets writing feels laggy even though the pen itself reports normally (the ink trails the stylus). Settings → Mobile handwriting → Ink display precision caps the ink layer at a lower resolution (Balanced ≈ half the pixels, Smooth ≈ 40%), which usually makes it responsive again. This changes on-screen resolution only — stroke data, coordinates, hit testing and exports are unaffected, and Native restores full sharpness at any time.
  • Ruler (pen bar → ruler icon, Apple Notes style): tap to place an opaque, frosted-white ruler with centimetre graduations (default length 10 cm at the current zoom) — the body itself is a drawing surface (WYSIWYG: draw straight on the ruler and the line lands just outside the working edge), the small pill grip in the middle moves it, the round knob rotates, and either end changes its length (the other end stays anchored); use the level button that appears beside the ruler icon to snap it back to horizontal. Like Apple Notes, the ruler lies below the line you draw and its working edge is the top edge (switchable to the opposite side via the Ruler side setting): a stroke drawn across the ruler straightens along that working edge, and the ink is nudged fully to the ruler's outer side with a hairline gap, so the body never covers it; the body is opaque except for a hairline slit at the working edge, so a stroke passing the ruler shows as a thin line there. Works with pen and highlighter; strokes away from the ruler are unaffected. Toggle the icon again to hide it. The ruler is session-only (not a setting) and the resulting straight strokes are ordinary ink — undo, eraser, sync and export all behave as usual.
  • Shapes (pen bar → shapes icon): drag to place a rectangle, ellipse or straight line (pick the kind in the shape flyout). Rectangles and ellipses can take a translucent highlighter-style fill from the palette (fluorescent yellow by default; "no fill" for outline only); the outline follows the shape tool's own color/width (both editable from the usual color and size buttons while the shape tool is active). Shapes are ordinary strokes: a tap won't create one (drag required), and after drawing you can tap a shape to select it (dashed box) and drag to move it. The eraser deletes a whole shape when it touches its outline, the lasso selects and moves them as a unit, and undo/sync work as usual.
  • Stroke-break / lag diagnostics (command palette → 「手写断触诊断」, mobile only): a passive, command-gated recorder that samples pointer and touch timing plus frame gaps while you write, and saves them to FleurPDF/ink-debug.json and FleurPDF/ink-debug.md inside your vault. These are local files; the plugin uploads nothing and has no telemetry. What a capture contains: event timestamps, the on-screen position of each sampled pointer/touch (i.e. roughly where on the page you were writing), pressure/size fields, the CSS class of the touched element, and small counters (how many canvases/pages/strokes are live, current pen width and opacity, frame-gap durations). What it does not contain: PDF text, note or file contents, file names, vault paths, account details, or API keys. Both files are safe to delete at any time, and the recorder only runs between the two invocations of that command.

📖 Usage Guide

Basic Annotations

  1. Select Text: Click and drag to select text in the PDF
  2. Right-Click Menu: Choose from the following options:
    • Highlight: Add a colored background to the text
    • Underline: Add an underline with various styles
    • Comment: Add a personal annotation
    • Ask AI: Get AI explanation of the selected text
    • AI Translation: Translate the text instantly

AI Features

AI Explain

Select text → Right-click → "Ask AI" → Get detailed explanation with:

  • Key concept definitions
  • Background context
  • Deep analysis
AI Translation

Select text → Right-click → "AI Translation" → Instant bidirectional translation (Chinese ↔ English)

AI Annotations

Highlight text → Click the 💡 icon in sidebar → AI generates intelligent annotations automatically

Managing Annotations

The sidebar shows all your annotations:

  • 📌 View all highlights and comments
  • ✏️ Edit annotations inline
  • 🗑️ Delete unwanted items
  • 💾 Export everything to a note

Exporting Notes

Click "Export Notes" in the sidebar to create a new Obsidian note with:

  • All highlights with page numbers
  • All comments and annotations
  • Organized by page for easy reference

Screenshot & OCR (network behaviour declaration)

The ink toolbar includes a camera tool: drag a rectangle over the PDF to capture a high-resolution region (re-rendered via pdf.js, independent of screen zoom). From the result panel you can copy the image, copy recognized text, ask the AI, or save to vault.

  • Text from digital PDFs is extracted from the PDF text layer — offline and exact.
  • Local OCR (tesseract.js, Apache-2.0, see THIRD-PARTY-NOTICES.md) runs entirely on your machine and is strictly opt-in (off by default). Only after you enable it in Settings are the engine files (worker script + WASM kernel, ~9.4 MB, version-pinned from jsDelivr) downloaded once on first use and cached in the plugin folder — fully offline afterwards. The language data file (plain data) is likewise downloaded once from the configured source and cached.
  • Vision model (optional) sends the screenshot to the endpoint you configure in Settings → Screenshot & OCR; nothing is sent without your explicit action.

🛠️ Development

Project Structure

fleur-pdf/
├── src/
│   ├── main.ts           # Plugin entry point
│   ├── patcher.ts        # PDF view interception
│   ├── sidebar.ts        # Annotation sidebar
│   ├── ai-chat-modal.ts  # AI dialog panel
│   ├── ai-service.ts     # AI API service
│   ├── settings.ts       # Settings panel
│   └── store.ts          # Data persistence
├── manifest.json
├── package.json
└── styles.css

Build Commands

npm run build      # Build for production
npm run dev        # Development mode with watch

🐛 Troubleshooting

"Text not found" Error

This can happen when:

  • The PDF text layer is not fully loaded
  • You're selecting across multiple pages

Solution: Wait a moment after selecting text, or try selecting again.

AI Not Responding

Check:

  • API Key is correctly configured
  • Base URL is accessible
  • Internet connection is stable

Use the "Test Connection" button to verify your setup.

📝 License

MIT License

🤝 Contributing

Contributions are welcome! Please feel free to submit issues or pull requests.


中文文档

✨ 功能特色

为什么选择 FleurPDF?

  1. 中文友好

    • 针对中文字符优化的文本选择
    • 正确处理 PDF 中的中日韩文字
    • 智能文本边界检测
  2. 所见即所得的高亮 + AI 批注

    • 高亮效果所见即所得,精确显示在选中的位置
    • AI 可以自动为高亮文本生成有见地的批注
    • 视觉反馈即时且准确
  3. AI 智能助手

    • AI 解释:获取选中文本的详细解释
    • AI 翻译:中英文即时互译
    • AI 批注:为高亮内容自动生成智能批注
    • 支持任何 OpenAI 兼容 API(DeepSeek、OpenAI 等)
  4. 一键导出笔记

    • 将所有批注和高亮导出为新的 Obsidian 笔记
    • 保留页码和结构组织
    • 非常适合创建阅读摘要
  5. PDF 页面便签(可选开启,v1.8.0)

    • 便签可拖拽 pin 在页面任意位置,自由缩放、可折叠成小脚注
    • 一键将全部便签整理导出为一篇 Markdown 笔记,再次导出自动覆盖同一篇
    • 底色与字号均可在设置里自定义
    • 完全本地:便签内容存在插件 data/ 目录下的 sidecar 文件(文件名为哈希,不含路径信息), 导出的笔记就是普通 vault 笔记,插件不上传任何内容

完整功能列表

  • 📝 高亮标注:黄色、蓝色、绿色等多种可自定义颜色
  • 📏 下划线:实线、虚线、点线、波浪线等多种样式
  • 💬 批注:为任何选中文本添加个人注释
  • 🤖 AI 功能:
    • 解释复杂段落
    • 翻译文本
    • 生成智能批注
    • 针对选中内容进行互动问答
  • 📊 侧边栏:在一个地方查看和管理所有批注
  • 📤 导出:一键导出为 Obsidian 笔记
  • 🎨 可定制:调整颜色、样式和 AI 设置

📦 安装方法

手动安装

  1. 从 latest release 下载 main.js、manifest.json、styles.css
  2. 创建文件夹 <vault>/.obsidian/plugins/fleur-pdf/
  3. 将三个文件放入该文件夹
  4. 重新加载 Obsidian
  5. 在设置 → 第三方插件中启用"FleurPDF"

从源码构建

git clone https://github.com/gibsonchan-5/fleur-pdf.git
cd fleur-pdf
npm install
npm run build

然后将 main.js、manifest.json 和 styles.css 复制到你的仓库的插件文件夹。

🔧 配置说明

AI 设置

  1. 打开 Obsidian 设置 → FleurPDF
  2. 选择 AI 提供商(DeepSeek、OpenAI 或自定义)
  3. 输入 API Key(默认保存在系统钥匙串,可选改为随 vault 同步)
  4. 如果使用自定义端点,配置 Base URL
  5. 点击"测试连接"验证设置

安全说明:主 AI 与视觉模型两把 API Key 默认存入 Obsidian 系统钥匙串(SecretStorage),不写入 data.json,因此不会随 vault 同步上传;只有在设置里显式把「密钥保存位置」改为 data.json 时,密钥才会以明文随 vault 同步。除调用你所配置的 AI 端点与内置词典源(有道词典 / dictionaryapi.dev,仅发送所查询单词本身)外,插件不向任何服务器发送笔记内容,也没有任何遥测或上报。

批注设置

  • 默认高亮颜色:选择您偏好的高亮颜色
  • 默认下划线样式:选择实线、虚线、点线或波浪线
  • 笔记导出文件夹:指定导出笔记的保存位置
  • 侧边栏位置:选择左侧或右侧边栏

批注跨设备同步(可选,默认关)

文本批注(高亮 / 划线 / 批注 / AI 结果)与手写笔迹都可在多台设备间同步。开启后,插件会在 vault 内 为每本有批注的 PDF 保留一份可见副本——文本批注在 FleurPDF/data/annotations/,手写笔迹在 FleurPDF/data/ink/——随你现有的同步方式(Remotely Save、iCloud 等)跨设备流动。合并时机:打开 PDF、每次批注落盘、检测到副本变更;编辑冲突按修改时刻后写者胜,删除记录为持久化墓碑,其他设备上的 旧副本不会让已删批注「复活」。需要在每台设备上分别开启开关。 副本只存在于你自己的 vault 中, 插件不向任何服务器发送内容,也没有遥测。

移动端手写批注

手写笔迹画在插件自建的覆盖层 canvas 上,笔迹数据存在 vault 内的 FleurPDF/data/ sidecar 文件里, 不会写进你的 PDF 原件,也只写在你自己的 vault 中。

  • 笔迹显示精度:笔迹层的栅格化与合成开销随屏幕 DPR 增长。平板上如果出现「笔的采样一切正常、 字却跟不上笔尖」的卡顿,可在设置 → 移动端手写批注里把这一项改为「均衡」(像素量约减半)或 「流畅」(约减六成),通常会立刻跟手。它只改显示分辨率:笔迹数据、坐标、命中测试、导出一律 不受影响,随时改回「原始」即可恢复最锐利的笔迹。
  • 直尺(笔盒 → 直尺图标,Apple Notes 式):点按在页面上放一把带厘米刻度的磨砂白直尺(尺身 不透明,底下的旧笔迹不会大片透出来;只有工作边留一条 6px 透明缝,经过尺沿的墨在缝里露出 一线,划没划线看得见),默认长 10 厘米(按当前缩放换算,尺面铺满 0–10 刻度)—— 尺身即书写面,所见即所得:直接在尺上画,墨沿工作边外侧落线;拖中央胶囊把手移动、 拖右端圆钮旋转、拖左右两端调长短(另一端锚定),其余尺面不感应拖拽、只管落墨, 直尺图标旁会出现「恢复水平」按钮一键扳平;设置里可用「直尺朝向」选择尺子在笔画 下方(默认)还是上方。书写逻辑与 Apple Notes 对齐:尺子躺在要画的线的对面,工作边朝向笔画——划线经过尺子就沿工作边被拉直, 且整条墨落在尺子外侧,只留一道小缝贴着尺沿,尺身不遮墨。钢笔 / 荧光笔都可用,离尺 较远的笔迹不受影响。再点一次图标即收起。直尺是会话内的(不进设置),画出的直线就是普通笔迹 —— 撤销、橡皮、同步、导出一律按普通笔迹处理。
  • 形状(笔盒 → 形状图标):拖拽画出矩形、圆形或直线(形状在弹层里三选一)。矩形和圆形 可从色板选半透明荧光笔式填充(默认荧光黄,也可选「无填充」只描边);描边颜色与粗细用形状 工具自己的参数(形状模式激活时,笔盒的颜色 / 粗细按钮改的就是它)。形状就是普通笔迹: 点按不成形(必须拖拽);画完后点一下形状即可选中(出现虚线框),再拖动可整体平移。 橡皮碰到轮廓整条删、套索整体圈选平移,撤销 / 同步照常。
  • 断触 / 卡顿诊断(命令面板 → 「手写断触诊断」,仅移动端):一个被命令开关的被动记录器, 在你书写期间采样指针/触摸时序与帧间隔,写入 vault 内的 FleurPDF/ink-debug.json 与 FleurPDF/ink-debug.md。这两个文件只落在本机,插件不上传任何内容,也没有遥测。 记录内容:事件时间戳、每次采样的屏幕位置(大致等于你在页面上书写的地方)、压感/接触面尺寸、 被按到的元素 class,以及若干计数(当前挂着几页覆盖层、多少笔迹、笔的粗细与透明度、掉帧毫秒数)。 记录内容不包括:PDF 文字、笔记正文、文件名、vault 路径、账号信息、API Key。 两个文件随时可以整篇删除,且记录器只在该命令运行期间工作。

📖 使用指南

基础批注

  1. 选中文本:在 PDF 中点击并拖动选择文本
  2. 右键菜单:从以下选项中选择:
    • 高亮:为文本添加彩色背景
    • 划线:添加各种样式的下划线
    • 批注:添加个人注释
    • 询问 AI:获取选中内容的 AI 解释
    • AI 翻译:即时翻译文本

AI 功能

AI 解释

选中文本 → 右键 → "询问 AI" → 获取详细解释,包括:

  • 关键概念定义
  • 背景信息
  • 深度分析
AI 翻译

选中文本 → 右键 → "AI 翻译" → 即时双向翻译(中文 ↔ 英文)

AI 批注

高亮文本 → 点击侧边栏的 💡 图标 → AI 自动生成智能批注

管理批注

侧边栏显示您的所有批注:

  • 📌 查看所有高亮和批注
  • ✏️ 内联编辑批注
  • 🗑️ 删除不需要的项目
  • 💾 全部导出为笔记

导出笔记

点击侧边栏中的"导出笔记"创建新的 Obsidian 笔记,包含:

  • 所有高亮及页码
  • 所有批注和注释
  • 按页码组织,便于查阅

🐛 故障排除

"未找到选中文本"错误

可能发生在:

  • PDF 文本层未完全加载
  • 跨页选择文本

解决方法:选中文本后稍等片刻,或重新选择。

AI 无响应

检查:

  • API Key 配置正确
  • Base URL 可访问
  • 网络连接稳定

使用"测试连接"按钮验证您的设置。

📝 许可证

MIT 许可证

🤝 贡献

欢迎贡献!请随时提交 issue 或 pull request。

Similar Plugins

info
• Similar plugins are suggested based on the common tags between the plugins.
DeepL
4 years ago by Till Friebe
DeepL for Obsidian.
Code Preview
4 years ago by Hank
Obsidian code block render by file path
Codeblock Customizer
4 years ago by mugiwara
Codeblock Customizer plugin for Obsidian
Ring a secretary
4 years ago by vorotamoroz
Copilot
4 years ago by Logan Yang
Run agents in Obsidian - OpenCode, Codex, Claude Code etc.
Pieces for Developers
3 years ago by Pieces For Developers
Pieces' powerful extension for Obsidian-MD that allows users to access their code snippets directly within the Obsidian workspace
Code Styler
3 years ago by Mayuran Visakan
A plugin for Obsidian.md for styling codeblocks and inline code
Keyword Highlighter
3 years ago by Marcel Goldammer
Automatically highlight specified keywords within your Obsidian notes for enhanced visibility and quick reference.
MantouAI
3 years ago by Morino Pan
MantouAI—— 让Obsidian变身智能助手
Multilingual
3 years ago by leolazou
An plugin for Obsidian that translates note names to ease linking across many languages.
Dictionary translator
3 years ago by Grover
我可以帮助你翻译单词或句子,听新单词或句子的录音,甚至录下自己的发音,以内部链接的形式保存到你的笔记中。
GDScript Syntax Highlighting
3 years ago by RobTheFiveNine
Adds live GDScript syntax highlighting to code blocks in the Obsidian editor.
Rapid AI
2 years ago by Rapid AI
AI Assistant for selected text and generating content with Markdown. Shortcuts and quick action buttons provide instant AI assistance. It provides a high availability API for unlimited Chat GPT request rates, so you can ensure smooth work for any workload.
Annotator
5 years ago by Elias Sundqvist
A plugin for reading and annotating PDFs and EPUBs in obsidian.
Highlightr
5 years ago by Chetachi
A minimal and aesthetically pleasing highlighting menu that makes color-coded highlighting much easier 🎨.
Memodack
2 years ago by Pavlo Kobyliatskyi
Your second language memory tool
CAO
2 years ago by Godot
Claude AI for Obsidian
Papyrus
2 years ago by André Silva, Daniel Guerra, Diogo Ferreira, Eduardo Barrancos
hello nemesis
2 years ago by Dian
Extended Markdown Syntax
2 years ago by Kotaindah55
Extend your Markdown syntax using delimiters instead of HTML tags, such as underlining, superscript, subscript, highlighting, and spoiler.
Sentence Rhythm
2 years ago by Adam Fletcher
Obsidian plugin added toggleable colored highlights to sentences based on their length
BibLib
2 years ago by Callum Alpass
Obsidian-based reference and literature note manager.
PDF Printer
a year ago by cubexy
Obsidian plugin that converts PDF documents to images directly in your notes without external dependencies.
Monokakido Copilot
a year ago by NoHeartPen
Double press the Option key to search with Dictionaries by Monokakido.This plugin is not affiliated with MONOKAKIDO Co. Ltd. (JAPAN).
Vault LLM Assistant
a year ago by Brians Tjipto
An obsidian notebook plugin that uses LLM (OpenAI or Gemini) to answer questions and create new notes about your vault
deepseek-ai-assistant
a year ago by algernon
Publish Note to Mowen Note
a year ago by ziyou
This is a mowen plugin for Obsidian (https://obsidian.md)
Long sentence highlighter
a year ago by Robert Meißner
VaultAI
a year ago by Tharushka Dinujaya
An AI chatbot plugin for Obsidian using the Gemini API for note summarization, content generation, and more. Enhance your workflow with AI assistance like the Notion AI bot.
Always Color Text
a year ago by Kazi Aidah Haque
Automatically colors texts across the Obsidian Vault!
DOCX Exporter
a year ago by Kanshurichard
An Obsidian plug-in, aiming to help users easily export note content into DOCX format.
AI Companion
a year ago by Kowshik
An Obsidian plugin that provides AI assistance using OpenAI's API, triggered by the `/ai` slash command.
Agent Client
6 months ago by rait-09
Bring AI agents into Obsidian via Agent Client Protocol (ACP), such as Claude Code, Codex and Gemini CLI.
PDF++
6 months ago by ryotaushio
PDF++: the most Obsidian-native PDF annotation & viewing tool ever. Comes with optional Vim keybindings.
LearnKit
5 months ago by William Guy
A native study system for your Obsidian vault. LearnKit turns notes into durable knowledge with flashcards, spaced repetition, reviews, tests, and AI tools.
SystemSculpt AI
5 months ago by systemsculpt
Chat with your Obsidian vault using your own Claude Code or Codex on desktop, or hosted AI. Edit notes with approval modes, transcribe audio and find related notes. Free to start.
Codex Panel
4 months ago by murashit
Codex in your sidebar. ChatGPT Work for your Obsidian vault.
LLM Hub
4 months ago by TAKESHI MORITA
Obsidian plugin for AI chat, workflow automation, and semantic search — supports Gemini, OpenAI, OpenRouter, Grok, Ollama, and CLI backends
Claudian Plus
4 months ago by wuyifan-code
Bible Reference
4 months ago by tim-hub
Take Bible Study notes easily in the popular note-taking app Obsidian, with automatic verse and reference suggestions.
Gemini Helper
4 months ago by TAKESHI MORITA
AI chat, workflow automation, semantic search (RAG), LLM Wiki (OKF) powered by Google Gemini. Works on both desktop and mobile.
Handwriting
3 months ago by Alan Liu
Pen ink on ordinary Markdown notes in Obsidian.
Qiaomu AI RSS
2 months ago by 向阳乔木
在 Obsidian 中阅读乔木 RSS、中文 AI 改写与翻译,并保存为 Markdown 笔记。
ICOR for Life - PDF Annotation
2 months ago by Thomas Roedl
Highlight text or draw a box on a PDF and get a note in the vault for it, with a deep link back, a card on any canvas by drag and drop, and a sidebar of every highlight in the open PDF. Part of the ICOR for Life suite.
FleurEPUB
2 months ago by JC5
Universal UI Translator
2 months ago by feifei
OsyC
2 months ago by 3yesore
Pick Me
2 months ago by seanishoo
Annotate and ask questions about what you select — in notes and in PDFs — without leaving the page. Annotations live in their own Markdown files; the original document is never modified.
yh-InkLight
2 months ago by angelwdx