syncfusion-react-pdf-viewer
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseSyncfusion 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:
- Search the reference files for the exact API/property name
- Verify it appears in the Method Reference, Properties, or Events tables
- If NOT found in ANY reference file, STOP immediately
- 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
- If a requested scenario/feature/API is NOT listed in any reference file, you MUST respond with:
-
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和属性生成代码。任何偏离都属于违规。
-
生成代码前的强制检查:
- 在参考文件中搜索确切的API/属性名称
- 验证其是否出现在方法参考、属性或事件表格中
- 如果在任何参考文件中都未找到,立即停止操作
- 任何情况下都不得生成或建议未文档化的API
-
严格执行——零容忍:
- 禁止自定义属性 - 仅使用参考文件表格中的属性
- 禁止自创方法 - 仅使用参考文件表格中的方法
- 禁止使用未定义API的变通方案 - 严令禁止
- 禁止对未文档化行为做假设 - 严令禁止
- 禁止基于猜测的替代实现 - 严令禁止
- 禁止谎称支持某项功能 - 严令禁止
-
不支持功能的强制响应:
- 如果请求的场景/功能/API未在任何参考文件中列出,必须回复:
"This feature is not supported in the current Syncfusion React PDF Viewer implementation." - 然后列出参考文件中支持的相关功能
- 除非参考文件中明确记录,否则不得建议替代方案
- 如果请求的场景/功能/API未在任何参考文件中列出,必须回复:
-
参考文件层级:
- 每个参考文件包含其领域的完整权威文档
- 表格(方法参考、属性、事件)是唯一的事实来源
- 参考文件中表格之外的内容仅作解释用
- 不得扩展到参考文件表格中未提及的内容
-
生成内容审核:
- 在提供任何代码之前,验证所使用的每个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:
- (project configuration and dependencies)
package.json - (TypeScript configuration)
tsconfig.json - or
App.tsx(root component)App.jsx - or
vite.config.ts(build configuration)webpack.config.js - Any existing or
.tsxfiles in src/ folder.jsx
- Output: Confirm the detected application type is a React TypeScript or JavaScript project before proceeding.
- 使用file_search和read_file工具检查工作区项目文件:
- (项目配置和依赖)
package.json - (TypeScript配置)
tsconfig.json - 或
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 file(s) for the requested feature
references/*.md - 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 tool on relevant
read_filefilesreferences/*.md - Confirm file contains Methods/Properties/Events tables
- Verify tables are complete and readable
- Use
- 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 directory."
references/ - 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 directory."
references/ - 列出缺失的参考文件名
- 这是阻塞步骤: 未通过参考文件验证则无法继续
- 如果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 for TypeScript type checking
type { SettingsNameModel } - 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>
);
}何时导入类型和枚举:
- 导入以进行TypeScript类型检查
type { SettingsNameModel } - 导入设置中使用的任何枚举(例如、
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 | No → Skip type import
type { SettingsModel } - 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 . Each file is a focused snippet or template the agent will combine when generating samples.
references/*.mdFlow: Always start with , then merge matched features into its anchors (PROPS, EVENTS, UI_BUTTONS, HANDLERS). If no keyword matches, return only the basic sample.
references/basic-sample.md所有模板和操作片段都存储在中。代理在生成示例时,会组合这些专注的片段或模板。
references/*.md流程: 始终从开始,然后将匹配的功能合并到其锚点(PROPS、EVENTS、UI_BUTTONS、HANDLERS)中。如果没有匹配的关键词,仅返回基础示例。
references/basic-sample.mdReference File Routing Guide
参考文件路由指南
🎯 Core Setup & Configuration
🎯 核心设置与配置
| File | Purpose | Route When User Asks About |
|---|---|---|
| basic-sample.md | Minimal PDFViewer with documentPath, height, and width. Base template for all samples. | "basic setup", "minimal example", "getting started", "how to load PDF" |
| general-properties.md | Configure core viewer properties (server URL, document path, locale, resource base path). | "configuration", "server settings", "locale", "document path setup" |
| enable-properties.md | Enable/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
📐 导航()与页面管理
| File | Purpose | Route When User Asks About |
|---|---|---|
| page-navigation.md | Navigate 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.md | Navigate using PDF bookmarks/table of contents in the bookmark panel. CRITICAL: All bookmark methods MUST be accessed via | "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 | Configure hyperlink navigation behavior and external link handling in PDFs. | "hyperlinks", "external links", "URL navigation", "clickable links", "url", "link" |
| thumbnail-navigation.md | Display 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书签/目录进行导航。关键:所有书签方法必须通过 | "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
🔍 查看与交互
| File | Purpose | Route When User Asks About |
|---|---|---|
| magnification.md | Configure zoom levels, zoom modes, and magnification controls (fit-to-page, fit-to-width). | "zoom", "magnification", "fit to page", "zoom levels", "scale document" |
| interaction-mode.md | Switch between Selection mode (text selection) and Panning mode (touch scrolling). | "text selection", "panning", "scroll mode", "interaction mode", "touch navigation" |
| text-selection.md | Enable text selection, copying text, and text selection events. | "select text", "copy text", "highlight text to copy", "text selection mode" |
| text-search.md | Implement 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
工具栏配置
| File | Purpose | Route When User Asks About |
|---|---|---|
| toolbar-settings.md | Configure toolbar visibility, tooltip behavior, and customize/remove toolbar items. | "customize toolbar", "hide toolbar items", "remove toolbar buttons", "toolbar configuration" |
| toolbar-methods.md | Programmatically 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:
-
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
-
VALIDATE item names character-by-character
- Case sensitivity matters: ≠
HighlightToolHighlightOption - Exact names only: ≠
AnnotationEditToolAnotatetionEditTool - No abbreviations or shortcuts
- Case sensitivity matters:
-
Before generating toolbar configuration code:
- Open reference file
toolbar-settings.md - 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 if unsure
toolbar-settings.md
- Open
-
Common errors to prevent:
- ❌ → ✅
AnotatetionEditTool(typo)AnnotationEditTool - ❌ → ✅
CalibrationOption(wrong suffix)CalibrateTool - ❌ → ✅
ShapeAnnotationOption(annotation toolbar version)ShapeTool - ❌ → ✅
InkAnnotationOption(annotation toolbar version)InkAnnotationTool - For complete list of mistakes to avoid, see "❌ COMMON MISTAKES TO AVOID" table
toolbar-settings.md
- ❌
生成工具栏配置时,必须遵循以下规则以避免不正确的工具栏项名称:
-
始终参考中的确切项名称
toolbar-settings.md- 不得发明、猜测或假设工具栏项名称
- 不得应用命名模式逻辑来推导名称
- 仅使用中“可用主工具栏项”、“可用注释工具栏项”和“可用表单设计器项”部分列出的名称
toolbar-settings.md
-
逐字符验证项名称
- 区分大小写:≠
HighlightToolHighlightOption - 仅使用确切名称:≠
AnnotationEditToolAnotatetionEditTool - 不得使用缩写或简写
- 区分大小写:
-
生成工具栏配置代码前:
- 打开参考文件
toolbar-settings.md - 找到:"Available Primary Toolbar Items"部分
- 找到:"Available Annotation Toolbar Items"部分
- 找到:"Available Form Designer Items"部分
- 仅从这些部分复制确切名称
- 逐字符交叉检查每个项名称
- 如果任何项名称不在参考部分中,不得使用
- 如有疑问,请查阅中的“❌ COMMON MISTAKES TO AVOID”表格
toolbar-settings.md
- 打开
-
需要避免的常见错误:
- ❌ → ✅
AnotatetionEditTool(拼写错误)AnnotationEditTool - ❌ → ✅
CalibrationOption(后缀错误)CalibrateTool - ❌ → ✅
ShapeAnnotationOption(注释工具栏版本)ShapeTool - ❌ → ✅
InkAnnotationOption(注释工具栏版本)InkAnnotationTool - 完整的错误避免列表,请参阅中的“❌ COMMON MISTAKES TO AVOID”表格
toolbar-settings.md
- ❌
Context Menu Customization
上下文菜单自定义
| File | Purpose | Route When User Asks About |
|---|---|---|
| contextmenu.md | Customize 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
📝 注释
| File | Purpose | Route When User Asks About |
|---|---|---|
| annotation-settings.md | Configure annotation appearance (colors, opacity, styles) and behavior for all annotation types. | "annotation colors", "annotation styles", "customize annotation appearance", "annotation defaults" |
| annotation-events.md | Handle annotation lifecycle events (add, delete, move, resize, select, property change). | "annotation events", "when annotation is added", "annotation change detection", "annotation callbacks" |
| shape-label-settings.md | Customize shape and measure annotation labels (position, color, font, visibility). | "annotation labels", "shape labels", "measurement labels", "label customization" |
| redaction-annotation.md | Create, 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
📄 表单
| File | Purpose | Route When User Asks About |
|---|---|---|
| form-field-settings.md | Configure 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.md | Handle 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
📋 文档操作
| File | Purpose | Route When User Asks About |
|---|---|---|
| download.md | Enable/configure PDF download functionality with custom filenames. | "download PDF", "save PDF", "export document", "download button" |
| print.md | Configure and trigger PDF printing functionality. | "print PDF", "print document", "printing options", "print button" |
| organize-pages.md | Reorder, 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
⚙️ 高级功能
| File | Purpose | Route When User Asks About |
|---|---|---|
| api-methods.md | Programmatic 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.md | Complete 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" |