syncfusion-react-pdf-viewer

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Syncfusion React Pdfviewer – UI Sample Generator

Syncfusion React Pdfviewer – UI示例生成器

Generate Code for the User's Project (default)

为用户项目生成代码(默认功能)

Trigger keywords: "how to", "add pdfviewer", "code sample", "show me", "example", "snippet", "integrate", "component", "create sample", "react sample".
Purpose: Generate minimal, copy-pasteable TS and HTML code that the user can integrate directly into their React project.
Workflow: ⚠️ CRITICAL — Feature Support Policy (STRICT MODE):
FUNDAMENTAL RULE: Only generate code using APIs and properties that are EXPLICITLY listed in the reference files. ANY deviation is a VIOLATION.
  • MANDATORY CHECKS BEFORE GENERATING ANY CODE:
    1. Search the reference files for the exact API/property name
    2. Verify it appears in the Method Reference, Properties, or Events tables
    3. If NOT found in ANY reference file, STOP immediately
    4. Do NOT generate or suggest undocumented APIs under any circumstances
  • STRICT ENFORCEMENT - ZERO TOLERANCE:
    • NO custom properties - Only use properties from reference file tables
    • NO invented methods - Only use methods from reference file tables
    • NO workarounds with undefined APIs - Forbidden
    • NO assumptions about undocumented behavior - Forbidden
    • NO alternative implementations using guess-work - Forbidden
    • NO pretending support exists - Forbidden
  • MANDATORY RESPONSE FOR UNSUPPORTED FEATURES:
    • If a requested scenario/feature/API is NOT listed in any reference file, you MUST respond with:
      "This feature is not supported in the current Syncfusion React PDF Viewer implementation."
    • Then list what IS supported from the appropriate reference file
    • Never suggest alternatives unless explicitly documented in reference files
  • REFERENCE FILE HIERARCHY:
    • Each reference file contains complete, authoritative documentation for its domain
    • The tables (Method Reference, Properties, Events) are the SOURCE OF TRUTH
    • Content outside these tables in reference files is explanatory only
    • Do NOT extend beyond what appears in the reference file tables
  • AUDIT YOUR GENERATION:
    • Before providing any code, verify EVERY API used appears in a reference file table
    • Document which reference file each API comes from
    • If you cannot cite a reference file table entry, DELETE that code
  • This is a CRITICAL REQUIREMENT. Violations compromise the skill's integrity and reliability.
触发关键词: "how to"、"add pdfviewer"、"code sample"、"show me"、"example"、"snippet"、"integrate"、"component"、"create sample"、"react sample"。
用途: 生成可直接复制粘贴到React项目中的极简TS和HTML代码。
工作流程: ⚠️ 关键——功能支持策略(严格模式):
基本原则: 仅使用参考文件中明确列出的API和属性生成代码。任何偏离都属于违规。
  • 生成代码前的强制检查:
    1. 在参考文件中搜索确切的API/属性名称
    2. 验证其是否出现在方法参考、属性或事件表格中
    3. 如果在任何参考文件中都未找到,立即停止操作
    4. 任何情况下都不得生成或建议未文档化的API
  • 严格执行——零容忍:
    • 禁止自定义属性 - 仅使用参考文件表格中的属性
    • 禁止自创方法 - 仅使用参考文件表格中的方法
    • 禁止使用未定义API的变通方案 - 严令禁止
    • 禁止对未文档化行为做假设 - 严令禁止
    • 禁止基于猜测的替代实现 - 严令禁止
    • 禁止谎称支持某项功能 - 严令禁止
  • 不支持功能的强制响应:
    • 如果请求的场景/功能/API未在任何参考文件中列出,必须回复:
      "This feature is not supported in the current Syncfusion React PDF Viewer implementation."
    • 然后列出参考文件中支持的相关功能
    • 除非参考文件中明确记录,否则不得建议替代方案
  • 参考文件层级:
    • 每个参考文件包含其领域的完整权威文档
    • 表格(方法参考、属性、事件)是唯一的事实来源
    • 参考文件中表格之外的内容仅作解释用
    • 不得扩展到参考文件表格中未提及的内容
  • 生成内容审核:
    • 在提供任何代码之前,验证所使用的每个API都出现在参考文件表格中
    • 记录每个API来自哪个参考文件
    • 如果无法引用参考文件表格中的条目,删除该代码
  • 这是关键要求。违规会损害本工具的完整性和可靠性。

Step 1 — Detect the Application Type (REQUIRED - DO NOT SKIP)

步骤1 — 检测应用类型(必填——不得跳过)

  • Use file_search and read_file tools to inspect workspace project files:
    • package.json
      (project configuration and dependencies)
    • tsconfig.json
      (TypeScript configuration)
    • App.tsx
      or
      App.jsx
      (root component)
    • vite.config.ts
      or
      webpack.config.js
      (build configuration)
    • Any existing
      .tsx
      or
      .jsx
      files in src/ folder
  • Output: Confirm the detected application type is a React TypeScript or JavaScript project before proceeding.
  • 使用file_search和read_file工具检查工作区项目文件:
    • package.json
      (项目配置和依赖)
    • tsconfig.json
      (TypeScript配置)
    • App.tsx
      App.jsx
      (根组件)
    • vite.config.ts
      webpack.config.js
      (构建配置)
    • src/文件夹中任何现有的
      .tsx
      .jsx
      文件
  • 输出: 在继续操作前,确认检测到的应用类型是React TypeScript或JavaScript项目。

Step 2 — Generate Code from Reference Files Only (REQUIRED)

步骤2 — 仅从参考文件生成代码(必填)

  • Before generating: Confirm that Steps 1 are complete
  • Read the relevant
    references/*.md
    file(s) for the requested feature
  • Cross-reference EVERY API, property, and method against these tables
  • COMPONENT-BASED APPROACH (MANDATORY - REACT PATTERNS ONLY):
    • Use JSX/TSX syntax for React component composition
    • Configure all PDF Viewer properties directly as component props
    • Use React hooks (useState, useRef, useEffect) when programmatic access is needed
  • MANDATORY: Before generating ANY code, verify that reference files exist and are accessible
  • Read the appropriate reference file(s) for the requested feature:
    • Use
      read_file
      tool on relevant
      references/*.md
      files
    • Confirm file contains Methods/Properties/Events tables
    • Verify tables are complete and readable
  • If reference file is missing or cannot be read:
    • STOP code generation
    • Respond: "Reference file for this feature is not available. Please ensure all reference files are present in the
      references/
      directory."
    • List the missing reference file name
  • This is a BLOCKER step: Cannot proceed without reference file validation
  • If an API/property does NOT appear in the reference file table, DO NOT USE IT
  • Do NOT invent, guess, or suggest any API, method, property, class, or namespace not explicitly present in the reference files

  • 生成前: 确认步骤1已完成
  • 读取与请求功能相关的
    references/*.md
    文件
  • 将每个API、属性和方法与这些表格进行交叉验证
  • 基于组件的方法(必填——仅使用React模式):
    • 使用JSX/TSX语法进行React组件组合
    • 直接将所有PDF查看器属性配置为组件props
    • 当需要程序化访问时,使用React hooks(useState、useRef、useEffect)
  • 必填: 在生成任何代码之前,确认参考文件存在且可访问
  • 读取与请求功能相关的参考文件:
    • 对相关的
      references/*.md
      文件使用
      read_file
      工具
    • 确认文件包含方法/属性/事件表格
    • 验证表格完整且可读
  • 如果参考文件缺失或无法读取:
    • 停止代码生成
    • 回复:"Reference file for this feature is not available. Please ensure all reference files are present in the
      references/
      directory."
    • 列出缺失的参考文件名
  • 这是阻塞步骤: 未通过参考文件验证则无法继续
  • 如果API/属性未出现在参考文件表格中,不得使用
  • 不得发明、猜测或建议任何未在参考文件中明确列出的API、方法、属性、类或命名空间

⚙️ SETTINGS CONFIGURATION BEST PRACTICES

⚙️ 设置配置最佳实践

When generating code with settings (toolbarSettings, annotationSettings, annotationSelectorSettings, arrowSettings, rectangleSettings, etc.), follow these guidelines to prevent unnecessary imports and over-engineering:
当生成包含设置(toolbarSettings、annotationSettings、annotationSelectorSettings、arrowSettings、rectangleSettings等)的代码时,请遵循以下准则,以避免不必要的导入和过度设计:

Rule 1: Simple Settings → Define INLINE in Component Props

规则1:简单设置 → 在组件Props中内联定义

Use this approach when:
  • Configuring only 1-3 properties
  • Settings are straightforward without complex enums or custom types
  • No need for TypeScript typed constants
Example (DO THIS):
tsx
<PdfViewerComponent
  id="container"
  documentPath="https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf"
  annotationSelectorSettings={{
    selectionBorderColor: '#0000ff',
    selectionBorderThickness: 2,
    resizerBorderColor: '#ff0000',
    resizerFillColor: '#4070ff',
    resizerSize: 8,
  }}
  style={{ height: '640px' }}
>
  <Inject services={[Annotation]} />
</PdfViewerComponent>
Benefits:
  • ✅ No extra imports needed
  • ✅ Simple and readable
  • ✅ Less code clutter
  • ✅ Type checking still works

适用场景:
  • 仅配置1-3个属性
  • 设置简单,无需复杂枚举或自定义类型
  • 不需要TypeScript类型化常量
示例(推荐做法):
tsx
<PdfViewerComponent
  id="container"
  documentPath="https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf"
  annotationSelectorSettings={{
    selectionBorderColor: '#0000ff',
    selectionBorderThickness: 2,
    resizerBorderColor: '#ff0000',
    resizerFillColor: '#4070ff',
    resizerSize: 8,
  }}
  style={{ height: '640px' }}
>
  <Inject services={[Annotation]} />
</PdfViewerComponent>
优势:
  • ✅ 无需额外导入
  • ✅ 简洁易读
  • ✅ 减少代码冗余
  • ✅ 仍可进行类型检查

Rule 2: Complex Settings → Define as Typed Constant (OUTSIDE component)

规则2:复杂设置 → 定义为类型化常量(组件外部)

Use this approach when:
  • Configuring 4+ properties OR multiple related settings
  • Using enums or complex configurations
  • Need to reuse the same configuration across multiple components
  • Settings are complex enough to warrant separate definition
Example (DO THIS ONLY FOR COMPLEX CASES):
tsx
import { PdfViewerComponent, Inject, Annotation } from '@syncfusion/ej2-react-pdfviewer';
import type { AnnotationSelectorSettingsModel } from '@syncfusion/ej2-react-pdfviewer';
import { AnnotationResizerLocation, CursorType } from '@syncfusion/ej2-react-pdfviewer';

// Define constant OUTSIDE component with proper types and enums
const annotationSelectorConfig: AnnotationSelectorSettingsModel = {
  selectionBorderColor: '#0000ff',
  selectionBorderThickness: 2,
  resizerBorderColor: '#ff0000',
  resizerFillColor: '#4070ff',
  resizerSize: 8,
  resizerShape: 'Square',
  selectorLineDashArray: [5, 6],
  resizerLocation: AnnotationResizerLocation.Corners | AnnotationResizerLocation.Edges,
  resizerCursorType: CursorType.grab,
};

export function App() {
  return (
    <PdfViewerComponent
      id="container"
      documentPath="https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf"
      annotationSelectorSettings={annotationSelectorConfig}
      style={{ height: '640px' }}
    >
      <Inject services={[Annotation]} />
    </PdfViewerComponent>
  );
}
When to import types and enums:
  • Import
    type { SettingsNameModel }
    for TypeScript type checking
  • Import any enums that are used in the settings (e.g.,
    AnnotationResizerLocation
    ,
    CursorType
    )
  • Keep imports minimal - import ONLY what is used in the settings
Benefits:
  • ✅ Type-safe configuration
  • ✅ Proper enum usage
  • ✅ Reusable across multiple components
  • ✅ Clean component code

适用场景:
  • 配置4个及以上属性,或多个相关设置
  • 使用枚举或复杂配置
  • 需要在多个组件中复用相同配置
  • 设置足够复杂,值得单独定义
示例(仅在复杂场景下使用):
tsx
import { PdfViewerComponent, Inject, Annotation } from '@syncfusion/ej2-react-pdfviewer';
import type { AnnotationSelectorSettingsModel } from '@syncfusion/ej2-react-pdfviewer';
import { AnnotationResizerLocation, CursorType } from '@syncfusion/ej2-react-pdfviewer';

// 在组件外部定义带正确类型和枚举的常量
const annotationSelectorConfig: AnnotationSelectorSettingsModel = {
  selectionBorderColor: '#0000ff',
  selectionBorderThickness: 2,
  resizerBorderColor: '#ff0000',
  resizerFillColor: '#4070ff',
  resizerSize: 8,
  resizerShape: 'Square',
  selectorLineDashArray: [5, 6],
  resizerLocation: AnnotationResizerLocation.Corners | AnnotationResizerLocation.Edges,
  resizerCursorType: CursorType.grab,
};

export function App() {
  return (
    <PdfViewerComponent
      id="container"
      documentPath="https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf"
      annotationSelectorSettings={annotationSelectorConfig}
      style={{ height: '640px' }}
    >
      <Inject services={[Annotation]} />
    </PdfViewerComponent>
  );
}
何时导入类型和枚举:
  • 导入
    type { SettingsNameModel }
    以进行TypeScript类型检查
  • 导入设置中使用的任何枚举(例如
    AnnotationResizerLocation
    CursorType
  • 最小化导入——仅导入设置中使用的内容
优势:
  • ✅ 类型安全的配置
  • ✅ 正确使用枚举
  • ✅ 可在多个组件中复用
  • ✅ 组件代码更简洁

Rule 3: NEVER Over-Engineer Simple Cases

规则3:切勿对简单场景过度设计

❌ DO NOT DO THIS (Over-engineered):
tsx
import { PdfViewerComponent, Inject, Annotation } from '@syncfusion/ej2-react-pdfviewer';
import type { ToolbarSettingsModel } from '@syncfusion/ej2-react-pdfviewer';

// Unnecessary constant for 2 simple properties
const toolbarSettings: ToolbarSettingsModel = {
  showTooltip: true,
};

export function App() {
  return (
    <PdfViewerComponent
      toolbarSettings={toolbarSettings}
      // ... rest of props
    />
  );
}
✅ DO THIS INSTEAD (Simple & Clean):
tsx
<PdfViewerComponent
  toolbarSettings={{ showTooltip: true }}
  // ... rest of props
/>

❌ 不推荐做法(过度设计):
tsx
import { PdfViewerComponent, Inject, Annotation } from '@syncfusion/ej2-react-pdfviewer';
import type { ToolbarSettingsModel } from '@syncfusion/ej2-react-pdfviewer';

// 为2个简单属性定义不必要的常量
const toolbarSettings: ToolbarSettingsModel = {
  showTooltip: true,
};

export function App() {
  return (
    <PdfViewerComponent
      toolbarSettings={toolbarSettings}
      // ... 其他props
    />
  );
}
✅ 推荐做法(简洁清晰):
tsx
<PdfViewerComponent
  toolbarSettings={{ showTooltip: true }}
  // ... 其他props
/>

Checklist Before Generating Code

生成代码前的检查清单

  • Count the settings properties: 1-3? → Use inline | 4+? → Use constant
  • Are enums involved? Yes → Must use typed constant with imports | No → Can use inline
  • Is it reused elsewhere? Yes → Use constant | No → Prefer inline
  • Do I need type safety? Yes → Import
    type { SettingsModel }
    | No → Skip type import
  • Do I need enums? Yes → Import required enums | No → Skip enum imports
  • Is the component prop simple enough? Yes → Keep inline | No → Extract to constant

  • 统计设置属性数量: 1-3个?→ 使用内联 | 4个及以上?→ 使用常量
  • 是否涉及枚举? 是 → 必须使用带导入的类型化常量 | 否 → 可使用内联
  • 是否在其他地方复用? 是 → 使用常量 | 否 → 优先使用内联
  • 是否需要类型安全? 是 → 导入
    type { SettingsModel }
    | 否 → 跳过类型导入
  • 是否需要枚举? 是 → 导入所需枚举 | 否 → 跳过枚举导入
  • 组件props是否足够简单? 是 → 保持内联 | 否 → 提取为常量

Code References

代码参考

All templates and operation snippets live in
references/*.md
. Each file is a focused snippet or template the agent will combine when generating samples.
Flow: Always start with
references/basic-sample.md
, then merge matched features into its anchors (PROPS, EVENTS, UI_BUTTONS, HANDLERS). If no keyword matches, return only the basic sample.

所有模板和操作片段都存储在
references/*.md
中。代理在生成示例时,会组合这些专注的片段或模板。
流程: 始终从
references/basic-sample.md
开始,然后将匹配的功能合并到其锚点(PROPS、EVENTS、UI_BUTTONS、HANDLERS)中。如果没有匹配的关键词,仅返回基础示例。

Reference File Routing Guide

参考文件路由指南

🎯 Core Setup & Configuration

🎯 核心设置与配置

FilePurposeRoute When User Asks About
basic-sample.mdMinimal PDFViewer with documentPath, height, and width. Base template for all samples."basic setup", "minimal example", "getting started", "how to load PDF"
general-properties.mdConfigure core viewer properties (server URL, document path, locale, resource base path)."configuration", "server settings", "locale", "document path setup"
enable-properties.mdEnable/disable specific features (toolbar, annotations, forms, navigation, text selection, download, print)."disable toolbar", "hide features", "enable/disable", "read-only mode", "restrict features"
文件用途用户询问以下内容时路由至此
basic-sample.md包含documentPath、高度和宽度的极简PDFViewer。所有示例的基础模板。"basic setup"、"minimal example"、"getting started"、"how to load PDF"
general-properties.md配置核心查看器属性(服务器URL、文档路径、区域设置、资源基础路径)。"configuration"、"server settings"、"locale"、"document path setup"
enable-properties.md启用/禁用特定功能(工具栏、注释、表单、导航、文本选择、下载、打印)。"disable toolbar"、"hide features"、"enable/disable"、"read-only mode"、"restrict features"

📐 Navigation() & Page Management

📐 导航()与页面管理

FilePurposeRoute When User Asks About
page-navigation.mdNavigate between pages (first, last, next, previous page), go to specific page numbers."page navigation", "go to page", "next page", "previous page", "jump to page"
bookmark-navigation.mdNavigate using PDF bookmarks/table of contents in the bookmark panel. CRITICAL: All bookmark methods MUST be accessed via
viewerRef.current.bookmark.*
(e.g.,
viewerRef.current.bookmark.openBookmarkPane()
), NOT directly on
viewerRef.current
"bookmarks", "bookmark", "table of contents", "TOC navigation", "outline panel", "get bookmarks", "retrieve bookmarks", "fetch bookmarks", "bookmarks programmatically", "getBookmarks", "goToBookmark", "bookmark API", "list bookmarks", "open bookmark", "close bookmark"
hyperlink-navigation.mdConfigure hyperlink navigation behavior and external link handling in PDFs."hyperlinks", "external links", "URL navigation", "clickable links", "url", "link"
thumbnail-navigation.mdDisplay and navigate using page thumbnails in the thumbnail panel."thumbnails", "preview pages", "thumbnail panel", "thumbnail","page previews"
文件用途用户询问以下内容时路由至此
page-navigation.md在页面间导航(首页、末页、下一页、上一页),跳转到特定页码。"page navigation"、"go to page"、"next page"、"previous page"、"jump to page"
bookmark-navigation.md使用书签面板中的PDF书签/目录进行导航。关键:所有书签方法必须通过
viewerRef.current.bookmark.*
访问(例如
viewerRef.current.bookmark.openBookmarkPane()
),不得直接通过
viewerRef.current
访问
"bookmarks"、"bookmark"、"table of contents"、"TOC navigation"、"outline panel"、"get bookmarks"、"retrieve bookmarks"、"fetch bookmarks"、"bookmarks programmatically"、"getBookmarks"、"goToBookmark"、"bookmark API"、"list bookmarks"、"open bookmark"、"close bookmark"
hyperlink-navigation.md配置PDF中的超链接导航行为和外部链接处理。"hyperlinks"、"external links"、"URL navigation"、"clickable links"、"url"、"link"
thumbnail-navigation.md在缩略图面板中显示和通过页面缩略图导航。"thumbnails"、"preview pages"、"thumbnail panel"、"thumbnail"、"page previews"

🔍 Viewing & Interaction

🔍 查看与交互

FilePurposeRoute When User Asks About
magnification.mdConfigure zoom levels, zoom modes, and magnification controls (fit-to-page, fit-to-width)."zoom", "magnification", "fit to page", "zoom levels", "scale document"
interaction-mode.mdSwitch between Selection mode (text selection) and Panning mode (touch scrolling)."text selection", "panning", "scroll mode", "interaction mode", "touch navigation"
text-selection.mdEnable text selection, copying text, and text selection events."select text", "copy text", "highlight text to copy", "text selection mode"
text-search.mdImplement text search functionality with search options and navigation."search text", "find in PDF", "search functionality", "highlight search results"
文件用途用户询问以下内容时路由至此
magnification.md配置缩放级别、缩放模式和放大控件(适合页面、适合宽度)。"zoom"、"magnification"、"fit to page"、"zoom levels"、"scale document"
interaction-mode.md在选择模式(文本选择)和平移模式(触摸滚动)之间切换。"text selection"、"panning"、"scroll mode"、"interaction mode"、"touch navigation"
text-selection.md启用文本选择、复制文本和文本选择事件。"select text"、"copy text"、"highlight text to copy"、"text selection mode"
text-search.md实现带搜索选项和导航的文本搜索功能。"search text"、"find in PDF"、"search functionality"、"highlight search results"

🛠️ Toolbar & Context Menu

🛠️ 工具栏与上下文菜单

Toolbar Configuration

工具栏配置

FilePurposeRoute When User Asks About
toolbar-settings.mdConfigure toolbar visibility, tooltip behavior, and customize/remove toolbar items."customize toolbar", "hide toolbar items", "remove toolbar buttons", "toolbar configuration"
toolbar-methods.mdProgrammatically show/hide toolbars and enable/disable toolbar items at runtime."show/hide toolbar dynamically", "toggle toolbar", "enable/disable toolbar items programmatically"
文件用途用户询问以下内容时路由至此
toolbar-settings.md配置工具栏可见性、提示行为,以及自定义/移除工具栏项。"customize toolbar"、"hide toolbar items"、"remove toolbar buttons"、"toolbar configuration"
toolbar-methods.md在运行时以编程方式显示/隐藏工具栏,启用/禁用工具栏项。"show/hide toolbar dynamically"、"toggle toolbar"、"enable/disable toolbar items programmatically"
⚠️ STRICT VALIDATION FOR TOOLBAR ITEM NAMES
⚠️ 工具栏项名称的严格验证
When generating toolbar configurations, you MUST follow these rules to prevent incorrect toolbar item names:
  1. ALWAYS reference exact item names from
    toolbar-settings.md
    • Do NOT invent, guess, or assume toolbar item names
    • Do NOT apply naming pattern logic to derive names
    • Use ONLY names listed in the "Available Primary Toolbar Items", "Available Annotation Toolbar Items", and "Available Form Designer Items" sections in
      toolbar-settings.md
  2. VALIDATE item names character-by-character
    • Case sensitivity matters:
      HighlightTool
      HighlightOption
    • Exact names only:
      AnnotationEditTool
      AnotatetionEditTool
    • No abbreviations or shortcuts
  3. Before generating toolbar configuration code:
    • Open
      toolbar-settings.md
      reference file
    • Locate: "Available Primary Toolbar Items" section
    • Locate: "Available Annotation Toolbar Items" section
    • Locate: "Available Form Designer Items" section
    • Copy exact names from THESE SECTIONS ONLY
    • Cross-check every single item name character-by-character
    • If ANY item name is not in the reference sections, DO NOT USE IT
    • Consult the "❌ COMMON MISTAKES TO AVOID" table in
      toolbar-settings.md
      if unsure
  4. Common errors to prevent:
    • AnotatetionEditTool
      → ✅
      AnnotationEditTool
      (typo)
    • CalibrationOption
      → ✅
      CalibrateTool
      (wrong suffix)
    • ShapeAnnotationOption
      → ✅
      ShapeTool
      (annotation toolbar version)
    • InkAnnotationOption
      → ✅
      InkAnnotationTool
      (annotation toolbar version)
    • For complete list of mistakes to avoid, see
      toolbar-settings.md
      "❌ COMMON MISTAKES TO AVOID" table
生成工具栏配置时,必须遵循以下规则以避免不正确的工具栏项名称:
  1. 始终参考
    toolbar-settings.md
    中的确切项名称
    • 不得发明、猜测或假设工具栏项名称
    • 不得应用命名模式逻辑来推导名称
    • 仅使用
      toolbar-settings.md
      中“可用主工具栏项”、“可用注释工具栏项”和“可用表单设计器项”部分列出的名称
  2. 逐字符验证项名称
    • 区分大小写:
      HighlightTool
      HighlightOption
    • 仅使用确切名称:
      AnnotationEditTool
      AnotatetionEditTool
    • 不得使用缩写或简写
  3. 生成工具栏配置代码前:
    • 打开
      toolbar-settings.md
      参考文件
    • 找到:"Available Primary Toolbar Items"部分
    • 找到:"Available Annotation Toolbar Items"部分
    • 找到:"Available Form Designer Items"部分
    • 仅从这些部分复制确切名称
    • 逐字符交叉检查每个项名称
    • 如果任何项名称不在参考部分中,不得使用
    • 如有疑问,请查阅
      toolbar-settings.md
      中的“❌ COMMON MISTAKES TO AVOID”表格
  4. 需要避免的常见错误:
    • AnotatetionEditTool
      → ✅
      AnnotationEditTool
      (拼写错误)
    • CalibrationOption
      → ✅
      CalibrateTool
      (后缀错误)
    • ShapeAnnotationOption
      → ✅
      ShapeTool
      (注释工具栏版本)
    • InkAnnotationOption
      → ✅
      InkAnnotationTool
      (注释工具栏版本)
    • 完整的错误避免列表,请参阅
      toolbar-settings.md
      中的“❌ COMMON MISTAKES TO AVOID”表格

Context Menu Customization

上下文菜单自定义

FilePurposeRoute When User Asks About
contextmenu.mdCustomize context menu items and handle context menu events."right-click menu", "context menu", "custom context menu", "disable context menu items"
文件用途用户询问以下内容时路由至此
contextmenu.md自定义上下文菜单项并处理上下文菜单事件。"right-click menu"、"context menu"、"custom context menu"、"disable context menu items"

📝 Annotations

📝 注释

FilePurposeRoute When User Asks About
annotation-settings.mdConfigure annotation appearance (colors, opacity, styles) and behavior for all annotation types."annotation colors", "annotation styles", "customize annotation appearance", "annotation defaults"
annotation-events.mdHandle annotation lifecycle events (add, delete, move, resize, select, property change)."annotation events", "when annotation is added", "annotation change detection", "annotation callbacks"
shape-label-settings.mdCustomize shape and measure annotation labels (position, color, font, visibility)."annotation labels", "shape labels", "measurement labels", "label customization"
redaction-annotation.mdCreate, configure, and apply redaction annotations to permanently remove sensitive content."redaction", "redact content", "remove sensitive data", "black out text", "permanent removal"
文件用途用户询问以下内容时路由至此
annotation-settings.md配置所有注释类型的注释外观(颜色、透明度、样式)和行为。"annotation colors"、"annotation styles"、"customize annotation appearance"、"annotation defaults"
annotation-events.md处理注释生命周期事件(添加、删除、移动、调整大小、选择、属性更改)。"annotation events"、"when annotation is added"、"annotation change detection"、"annotation callbacks"
shape-label-settings.md自定义形状和测量注释标签(位置、颜色、字体、可见性)。"annotation labels"、"shape labels"、"measurement labels"、"label customization"
redaction-annotation.md创建、配置和应用编辑注释,以永久删除敏感内容。"redaction"、"redact content"、"remove sensitive data"、"black out text"、"permanent removal"

📄 Forms

📄 表单

FilePurposeRoute When User Asks About
form-field-settings.mdConfigure default properties for form fields (text, checkbox, radio, dropdown, signature)."form field defaults", "form field styles", "configure form fields", "form field properties"
form-field-events.mdHandle form field interaction events (focus, blur, value change, validation)."form field events", "when field changes", "form validation events", "field interaction callbacks"
文件用途用户询问以下内容时路由至此
form-field-settings.md配置表单字段(文本、复选框、单选框、下拉框、签名)的默认属性。"form field defaults"、"form field styles"、"configure form fields"、"form field properties"
form-field-events.md处理表单字段交互事件(焦点、失焦、值更改、验证)。"form field events"、"when field changes"、"form validation events"、"field interaction callbacks"

📋 Document Actions

📋 文档操作

FilePurposeRoute When User Asks About
download.mdEnable/configure PDF download functionality with custom filenames."download PDF", "save PDF", "export document", "download button"
print.mdConfigure and trigger PDF printing functionality."print PDF", "print document", "printing options", "print button"
organize-pages.mdReorder, rotate, insert, remove, copy, import, and extract PDF pages."reorder pages", "rotate pages", "add blank pages", "remove pages", "rearrange pages", "merge PDFs"
文件用途用户询问以下内容时路由至此
download.md启用/配置带自定义文件名的PDF下载功能。"download PDF"、"save PDF"、"export document"、"download button"
print.md配置并触发PDF打印功能。"print PDF"、"print document"、"printing options"、"print button"
organize-pages.md重新排序、旋转、插入、删除、复制、导入和提取PDF页面。"reorder pages"、"rotate pages"、"add blank pages"、"remove pages"、"rearrange pages"、"merge PDFs"

⚙️ Advanced Features

⚙️ 高级功能

FilePurposeRoute When User Asks About
api-methods.mdProgrammatic control: load documents, manage forms, annotations, extract text, undo/redo, navigation APIs."load PDF programmatically", "API methods", "export form data", "extract text", "undo/redo", "programmatic control"
events.mdComplete list of all PDFViewer events (document load, download, annotations, forms, search, navigation)."event list", "all events", "available events", "event reference", "event handlers"

文件用途用户询问以下内容时路由至此
api-methods.md程序化控制:加载文档、管理表单、注释、提取文本、撤销/重做、导航API。"load PDF programmatically"、"API methods"、"export form data"、"extract text"、"undo/redo"、"programmatic control"
events.md所有PDFViewer事件的完整列表(文档加载、下载、注释、表单、搜索、导航)。"event list"、"all events"、"available events"、"event reference"、"event handlers"