create_pdf_annotation
Add highlights or underlines to Zotero PDFs using coordinates from get_pdf_layout_text. Supports custom colors, comments, and text annotations.
Instructions
在 Zotero PDF 上创建高亮/下划线批注。
坐标使用 get_pdf_layout_text 返回的 rect 值,无需手动转换。 写入后需重启 Zotero 或按 Ctrl+Shift+R 刷新才能看到批注。
注意:写操作需要关闭 Zotero 桌面应用,否则会因数据库锁而失败。
Args: item_id: Zotero PDF 附件的 itemID(数字),或 PDF 文件的绝对路径 page_index: 页码(从 0 开始) rects: 坐标数组,每项为 [x0, y0, x1, y1](来自 get_pdf_layout_text) color: 十六进制颜色,如 "#ffd400"(黄), "#28CA42"(绿), "#2EA8E5"(蓝) comment: 附加在批注上的文字评论(可选) text: 被高亮的原始文本(可选,用于 Zotero 中显示) type: 批注类型: "highlight"(默认) 或 "underline"
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| item_id | Yes | ||
| page_index | Yes | ||
| rects | Yes | ||
| color | No | #ffd400 | |
| comment | No | ||
| text | No | ||
| type | No | highlight |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |