view-pdf

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

PDF Viewer — Interactive Document Workflows

PDF Viewer — 交互式文档工作流

You have access to a local PDF server that renders documents in a live viewer and lets you annotate, fill forms, and place signatures with real-time visual feedback.
你可以访问本地PDF服务器,它能在实时查看器中渲染文档,让你添加注释、填写表单并添加签名,同时提供实时视觉反馈。

When to use this skill

何时使用此技能

Use the PDF viewer when the user wants interactivity:
  • "Show me this contract" / "Open this paper"
  • "Highlight the key terms and let me review"
  • "Help me fill out this form"
  • "Sign this on page 3" / "Add my initials to each page"
  • "Stamp this CONFIDENTIAL" / "Mark this as approved"
  • "Walk me through this document and annotate the important parts"
Do NOT use the viewer for pure ingestion:
  • "Summarize this PDF" → use the native Read tool directly
  • "What does page 5 say?" → use Read
  • "Extract the table from section 3" → use Read
The viewer's value is showing the user the document and collaborating on markup — not streaming text back to you.
当用户需要交互功能时使用PDF查看器:
  • “给我展示这份合同” / “打开这份文件”
  • “高亮关键条款并让我审阅”
  • “帮我填写这份表单”
  • “在第3页签名” / “在每一页添加我的首字母”
  • “给这份文件盖上‘CONFIDENTIAL’(保密)章” / “标记此文件已批准”
  • “带我浏览这份文档并标注重要部分”
纯内容提取场景请勿使用查看器:
  • “总结这份PDF” → 直接使用原生Read工具
  • “第5页写了什么?” → 使用Read工具
  • “提取第3部分的表格” → 使用Read工具
查看器的核心价值在于向用户展示文档并协作完成标记,而非将文本内容返回给你。

Tools

工具

list_pdfs

list_pdfs

List available local PDFs and allowed local directories. No arguments.
列出可用的本地PDF文件和允许访问的本地目录。无参数。

display_pdf

display_pdf

Open a PDF in the interactive viewer. Call once per document.
  • url
    — local file path or HTTPS URL
  • page
    — initial page (optional, default 1)
  • elicit_form_inputs
    — if
    true
    , prompts the user to fill form fields before displaying (use for interactive form-filling)
Returns a
viewUUID
— pass this to every
interact
call. Calling
display_pdf
again creates a separate viewer; interact calls with the new UUID won't reach the one the user is looking at.
Also returns
formFields
(name, type, page, bounding box) if the PDF has fillable fields — use these coordinates for signature placement.
在交互式查看器中打开PDF。每个文档仅调用一次。
  • url
    — 本地文件路径或HTTPS URL
  • page
    — 初始页码(可选,默认值为1)
  • elicit_form_inputs
    — 如果设为
    true
    ,会在展示PDF前提示用户填写表单域(用于交互式表单填写场景)
返回
viewUUID
— 后续所有
interact
调用都需要传入此参数。再次调用
display_pdf
会创建一个独立的查看器;使用新UUID的
interact
调用无法作用于用户当前正在查看的那个查看器。
如果PDF包含可填写表单域,还会返回
formFields
(包含名称、类型、页码、边界框)——可使用这些坐标来放置签名。

interact

interact

All follow-up actions after
display_pdf
. Pass
viewUUID
plus one or more commands. Batch multiple commands in one call via the
commands
array — they run sequentially. End batches with
get_screenshot
to verify changes visually.
Annotation actions:
  • add_annotations
    — add markup (see types below)
  • update_annotations
    — modify existing (id + type required)
  • remove_annotations
    — delete by id array
  • highlight_text
    — auto-find text by query and highlight it (preferred over manual rects for text markup)
Navigation actions:
  • navigate
    (page),
    search
    (query),
    find
    (query, silent),
    search_navigate
    (matchIndex),
    zoom
    (scale 0.5–3.0)
Extraction actions:
  • get_text
    — extract text from page ranges (max 20 pages). Use for reading content to decide what to annotate, NOT for summarization.
  • get_screenshot
    — capture a page as an image (verify your annotations)
Form action:
  • fill_form
    — fill named fields:
    fields: [{name, value}, ...]
display_pdf
之后的所有后续操作。传入
viewUUID
以及一个或多个命令。可通过
commands
数组批量执行多个命令
——它们会按顺序运行。批量操作的最后可加上
get_screenshot
来可视化验证修改结果。
注释操作:
  • add_annotations
    — 添加标记(见下方类型说明)
  • update_annotations
    — 修改现有标记(需要id和类型)
  • remove_annotations
    — 通过id数组删除标记
  • highlight_text
    — 通过查询内容自动查找文本并高亮(对于文本标记,优先使用此方式而非手动绘制矩形)
导航操作:
  • navigate
    (跳转页码)、
    search
    (搜索内容)、
    find
    (搜索内容,静默模式)、
    search_navigate
    (跳转至指定匹配项)、
    zoom
    (缩放比例0.5–3.0)
提取操作:
  • get_text
    — 提取指定页码范围的文本(最多20页)。用于读取内容以决定要标记的部分,不用于摘要生成
  • get_screenshot
    — 将某一页捕获为图片(用于验证你的标记)
表单操作:
  • fill_form
    — 填写指定名称的表单域:
    fields: [{name, value}, ...]

Annotation Types

注释类型

All annotations need
id
(unique string),
type
,
page
(1-indexed). Coordinates are PDF points (1/72 inch), origin top-left, Y increases downward. US Letter is 612×792pt.
TypeKey propertiesUse for
highlight
rects
,
color?
,
content?
Mark important text
underline
rects
,
color?
Emphasize terms
strikethrough
rects
,
color?
Mark deletions
note
x
,
y
,
content
,
color?
Sticky-note comments
freetext
x
,
y
,
content
,
fontSize?
Visible text on page
rectangle
x
,
y
,
width
,
height
,
color?
,
fillColor?
Box regions
circle
x
,
y
,
width
,
height
,
color?
,
fillColor?
Circle regions
line
x1
,
y1
,
x2
,
y2
,
color?
Draw lines/arrows
stamp
x
,
y
,
label
,
color?
,
rotation?
APPROVED, DRAFT, CONFIDENTIAL, etc.
image
imageUrl
,
x?
,
y?
,
width?
,
height?
Signatures, initials, logos
Image annotations accept a local file path or HTTPS URL (no data: URIs). Dimensions auto-detected if omitted. Users can also drag & drop images directly onto the viewer.
所有注释都需要
id
(唯一字符串)、
type
page
(从1开始计数)。坐标采用PDF点(1/72英寸),原点为左上角,Y轴向下递增。美国信纸尺寸为612×792pt。
类型关键属性用途
highlight
rects
,
color?
,
content?
标记重要文本
underline
rects
,
color?
强调术语
strikethrough
rects
,
color?
标记需要删除的内容
note
x
,
y
,
content
,
color?
便签式评论
freetext
x
,
y
,
content
,
fontSize?
在页面上添加可见文本
rectangle
x
,
y
,
width
,
height
,
color?
,
fillColor?
框选区域
circle
x
,
y
,
width
,
height
,
color?
,
fillColor?
圈选区域
line
x1
,
y1
,
x2
,
y2
,
color?
绘制线条/箭头
stamp
x
,
y
,
label
,
color?
,
rotation?
添加印章,如APPROVED(已批准)、DRAFT(草稿)、CONFIDENTIAL(保密)等
image
imageUrl
,
x?
,
y?
,
width?
,
height?
添加签名、首字母、Logo等
图片注释支持本地文件路径或HTTPS URL(不支持data: URI)。如果省略尺寸参数,会自动检测尺寸。用户也可以直接将图片拖放到查看器中。

Interactive Workflows

交互式工作流

Collaborative annotation (AI-driven)

协作式注释(AI驱动)

  1. display_pdf
    to open the document
  2. interact
    get_text
    on relevant page range to understand content
  3. Propose a batch of annotations to the user (describe what you'll mark)
  4. On approval,
    interact
    add_annotations
    +
    get_screenshot
  5. Show the user, ask for edits, iterate
  6. When done, remind them they can download the annotated PDF from the viewer toolbar
  1. 调用
    display_pdf
    打开文档
  2. 调用
    interact
    get_text
    获取相关页码范围的内容以理解文档
  3. 向用户提议一批注释内容(描述你要标记的内容)
  4. 获得批准后,调用
    interact
    add_annotations
    +
    get_screenshot
  5. 展示给用户,询问是否需要修改,循环迭代
  6. 完成后,提醒用户可以从查看器工具栏下载带有注释的PDF

Form filling (visual, not programmatic)

表单填写(可视化,非程序化)

Unlike headless form tools, this gives the user live visual feedback and handles forms with cryptic/unnamed fields where the label is printed on the page rather than in field metadata.
  1. display_pdf
    — inspect returned
    formFields
    (name, type, page, bounding box)
  2. If field names are cryptic (
    Text1
    ,
    Field_7
    ),
    get_screenshot
    the pages and match bounding boxes to visual labels
  3. Ask the user for values using the visual labels, or infer from context
  4. interact
    fill_form
    , then
    get_screenshot
    to show the result
  5. User confirms or edits directly in the viewer
For simple well-labeled forms,
display_pdf
with
elicit_form_inputs: true
prompts the user upfront instead.
与无界面表单工具不同,此方式为用户提供实时视觉反馈,可处理字段名称不明确/无名称的表单——此类表单的标签是打印在页面上而非存储在字段元数据中。
  1. 调用
    display_pdf
    — 检查返回的
    formFields
    (名称、类型、页码、边界框)
  2. 如果字段名称不明确(如
    Text1
    Field_7
    ),调用
    get_screenshot
    获取页面截图,将边界框与可视化标签匹配
  3. 使用可视化标签向用户询问字段值,或根据上下文推断
  4. 调用
    interact
    fill_form
    ,然后调用
    get_screenshot
    展示结果
  5. 用户确认或直接在查看器中编辑
对于简单且标签清晰的表单,调用
display_pdf
时设置
elicit_form_inputs: true
,可提前提示用户填写。

Signing (visual, not certified)

签名添加(可视化,非认证式)

  1. Ask for the signature/initials image path
  2. display_pdf
    , check
    formFields
    for signature-type fields or ask which page/position
  3. interact
    add_annotations
    with
    type: "image"
    at the target coordinates
  4. get_screenshot
    to confirm placement
Disclaimer: This places a visual signature image. It is not a certified or cryptographic digital signature.
  1. 向用户索要签名/首字母的图片路径
  2. 调用
    display_pdf
    ,检查
    formFields
    是否有签名类型字段,或询问用户签名的页码/位置
  3. 调用
    interact
    add_annotations
    ,设置
    type: "image"
    并传入目标坐标
  4. 调用
    get_screenshot
    确认位置
免责声明: 此操作仅添加可视化签名图片,并非经过认证的加密数字签名。

Supported Sources

支持的来源

  • Local files (paths under client MCP roots)
  • arXiv (
    /abs/
    URLs auto-convert to PDF)
  • Any direct HTTPS PDF URL (bioRxiv, Zenodo, OSF, etc. — use the direct PDF link, not the landing page)
  • 本地文件(客户端MCP根目录下的路径)
  • arXiv(
    /abs/
    格式的URL会自动转换为PDF)
  • 任何直接的HTTPS PDF URL(如bioRxiv、Zenodo、OSF等——请使用直接PDF链接,而非着陆页)

Out of Scope

不支持的场景

  • Summarization / text extraction — use native Read instead
  • Certified digital signatures — image stamping only
  • PDF creation — this works on existing PDFs only
  • 摘要生成/文本提取 — 请使用原生Read工具
  • 认证式数字签名 — 仅支持图片盖章
  • PDF创建 — 此技能仅适用于现有PDF",