Syncfusion Vue Pdfviewer – UI Sample Generator
Target package: @syncfusion/ej2-vue-pdfviewer
Generate Code for the User's Project (default)
Trigger keywords: "how to", "add pdfviewer", "code sample", "show me", "example", "snippet", "integrate", "component", "create sample", "vue sample".
Purpose: Generate minimal, copy-pasteable Vue SFC (.vue) code that the user can integrate directly into their Vue 2 or Vue 3 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:
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.
Step 1 — Detect the Application Type (REQUIRED - DO NOT SKIP)
- Use file_search and read_file tools to inspect workspace project files:
package.json (project configuration and dependencies)
vite.config.js or vite.config.ts (Vue 3 Vite build config)
vue.config.js (Vue 2 Vue-CLI config)
App.vue (root component)
main.js or main.ts (app entry point — check for Vue.use(...) for Vue 2 vs createApp(...) for Vue 3)
- Any existing
.vue files in src/ folder
- Output: Confirm the detected application type is Vue 2 or Vue 3 before proceeding, as the component registration and API patterns differ.
Step 2 — Generate Code from Reference Files Only (REQUIRED)
- Before generating: Confirm that Step 1 is 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 - VUE PATTERNS ONLY):
- Use Vue SFC (
.vue) syntax with <template>, <script>, and <style> sections
- Use
<ejs-pdfviewer> as the component tag
- Bind all PDF Viewer properties using Vue's
:prop="value" binding syntax
- Vue 2: Register component via
components: { "ejs-pdfviewer": PdfViewerComponent } and inject services via provide: { PdfViewer: [...] }
- Vue 3 Composition API: Import
PdfViewerComponent as EjsPdfviewer and use provide('PdfViewer', [...]) from vue
- Vue 3 Options API: Use
components + provide options just like Vue 2 but with createApp entry
- Use
ref / $refs (Vue 2) or ref() + template ref attribute (Vue 3) for programmatic viewer access
- 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
Reference File Routing
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 getting-started.md, then merge matched features into its anchors (PROPS, EVENTS, UI_BUTTONS, HANDLERS). If no keyword matches, return only the basic sample.
Checklist Before Generating Code
🎯 Core Setup & Configuration
| File |
Purpose |
Route When User Asks About |
| getting-started.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" |
📐 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 this.$refs.pdfViewer.bookmark.* (Vue 2) or pdfViewerRef.value.bookmark.* (Vue 3 Composition API), NOT directly on the viewer instance. |
"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" |
🔍 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" |
🛠️ 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" |
⚠️ 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:
HighlightTool ≠ HighlightOption
- Exact names only:
AnnotationEditTool ≠ AnotatetionEditTool
- No abbreviations or shortcuts
Before generating toolbar configuration code:
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
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" |
📝 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" |
📄 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" |
📋 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" |
⚙️ 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" |
Quick Start Example
<template>
<ejs-pdfviewer
ref="pdfViewer"
:resourceUrl="resourceUrl"
:documentPath="documentPath"
style="height: 640px">
</ejs-pdfviewer>
</template>
<script setup>
import { provide } from 'vue';
import { PdfViewerComponent as EjsPdfviewer, Toolbar, Magnification, Navigation, LinkAnnotation,
BookmarkView, ThumbnailView, Print, TextSelection, TextSearch,
Annotation, FormDesigner, FormFields } from '@syncfusion/ej2-vue-pdfviewer';
const resourceUrl = window.location.origin + "/asset/ej2-pdfviewer-lib";
const documentPath = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf';
provide('PdfViewer', [ Toolbar, Magnification, Navigation, LinkAnnotation, BookmarkView, ThumbnailView,
Print, TextSelection, TextSearch, Annotation, FormDesigner, FormFields ]);
</script>
<style>
/* Refer to the CSS Configuration section for the full import list */
@import '../node_modules/@syncfusion/ej2-pdfviewer/styles/material.css';
</style>
⚙️ SETTINGS CONFIGURATION BEST PRACTICES
When generating code with settings (toolbarSettings, annotationSettings, annotationSelectorSettings, arrowSettings, rectangleSettings, etc.), follow these guidelines to prevent unnecessary complexity:
Rule 1: Simple Settings → Define INLINE in Component Binding
Use this approach when:
- Configuring only 1-3 properties
- Settings are straightforward without complex enums or custom types
- No need for separate data constants
Example (DO THIS):
<template>
<ejs-pdfviewer
id="container"
documentPath="https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf"
:annotationSelectorSettings="{
selectionBorderColor: '#0000ff',
selectionBorderThickness: 2,
resizerBorderColor: '#ff0000',
}"
style="height: 640px"
/>
</template>
Benefits:
- ✅ No extra data properties needed
- ✅ Simple and readable
- ✅ Less code clutter
Rule 2: Complex Settings → Define in data() / ref() (OUTSIDE template)
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
Example — Vue 2 Options API (DO THIS ONLY FOR COMPLEX CASES):
<template>
<ejs-pdfviewer
id="container"
:documentPath="documentPath"
:annotationSelectorSettings="annotationSelectorConfig"
style="height: 640px"
/>
</template>
<script>
import { PdfViewerComponent, Annotation,
AnnotationResizerLocation, CursorType } from '@syncfusion/ej2-vue-pdfviewer';
export default {
name: 'App',
components: { 'ejs-pdfviewer': PdfViewerComponent },
data() {
return {
documentPath: 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf',
annotationSelectorConfig: {
selectionBorderColor: '#0000ff',
selectionBorderThickness: 2,
resizerBorderColor: '#ff0000',
resizerFillColor: '#4070ff',
resizerSize: 8,
resizerShape: 'Square',
selectorLineDashArray: [5, 6],
resizerLocation: AnnotationResizerLocation.Corners | AnnotationResizerLocation.Edges,
resizerCursorType: CursorType.grab,
},
};
},
provide: { PdfViewer: [Annotation] },
};
</script>
Example — Vue 3 Composition API (DO THIS ONLY FOR COMPLEX CASES):
<script setup>
import { provide } from 'vue';
import { PdfViewerComponent as EjsPdfviewer, Annotation,
AnnotationResizerLocation, CursorType } from '@syncfusion/ej2-vue-pdfviewer';
const documentPath = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf';
const annotationSelectorConfig = {
selectionBorderColor: '#0000ff',
selectionBorderThickness: 2,
resizerBorderColor: '#ff0000',
resizerFillColor: '#4070ff',
resizerSize: 8,
resizerShape: 'Square',
selectorLineDashArray: [5, 6],
resizerLocation: AnnotationResizerLocation.Corners | AnnotationResizerLocation.Edges,
resizerCursorType: CursorType.grab,
};
provide('PdfViewer', [Annotation]);
</script>
When to import enums:
Benefits:
- ✅ Proper enum usage
- ✅ Reusable across multiple components
- ✅ Clean template code
Rule 3: NEVER Over-Engineer Simple Cases
❌ DO NOT DO THIS (Over-engineered):
<script>
import { PdfViewerComponent } from '@syncfusion/ej2-vue-pdfviewer';
export default {
components: { 'ejs-pdfviewer': PdfViewerComponent },
data() {
return {
// Unnecessary data property for 1 simple prop
toolbarSettings: { showTooltip: true },
};
},
};
</script>
✅ DO THIS INSTEAD (Simple & Clean):
<ejs-pdfviewer :toolbarSettings="{ showTooltip: true }" ... />
1---2name: syncfusion-vue-pdf-viewer3description: Implements the Syncfusion Vue PDF Viewer (ejs-pdfviewer) for embedding, configuring, and loading PDF documents. Use this when rendering PDFs in a Vue 2 or Vue 3 application, embedding viewer controls, or generating SFC (.vue) code for PDF display and interaction.4---56# Syncfusion Vue Pdfviewer – UI Sample Generator78Target package: `@syncfusion/ej2-vue-pdfviewer`910## Generate Code for the User's Project *(default)*1112**Trigger keywords:** "how to", "add pdfviewer", "code sample", "show me", "example", "snippet", "integrate", "component", "create sample", "vue sample".1314**Purpose:** Generate minimal, copy-pasteable Vue SFC (.vue) code that the user can integrate directly into their Vue 2 or Vue 3 project.1516**Workflow:**17**⚠️ CRITICAL — Feature Support Policy (STRICT MODE):**18 19**FUNDAMENTAL RULE:** Only generate code using APIs and properties that are EXPLICITLY listed in the reference files. ANY deviation is a VIOLATION.20 21- **MANDATORY CHECKS BEFORE GENERATING ANY CODE:**22 1. Search the reference files for the exact API/property name23 2. Verify it appears in the Method Reference, Properties, or Events tables24 3. If NOT found in ANY reference file, STOP immediately25 4. Do NOT generate or suggest undocumented APIs under any circumstances26 27- **STRICT ENFORCEMENT - ZERO TOLERANCE:**28 - **NO custom properties** - Only use properties from reference file tables29 - **NO invented methods** - Only use methods from reference file tables30 - **NO workarounds with undefined APIs** - Forbidden31 - **NO assumptions** about undocumented behavior - Forbidden32 - **NO alternative implementations** using guess-work - Forbidden33 - **NO pretending support exists** - Forbidden34 35- **MANDATORY RESPONSE FOR UNSUPPORTED FEATURES:**36 - **If a requested scenario/feature/API is NOT listed in any reference file, you MUST respond with:**37 ```38 "This feature is not supported in the current Syncfusion Vue PDF Viewer implementation."39 ```40 - **Then list what IS supported** from the appropriate reference file41 - **Never suggest alternatives** unless explicitly documented in reference files42 43- **REFERENCE FILE HIERARCHY:**44 - Each reference file contains complete, authoritative documentation for its domain45 - The tables (Method Reference, Properties, Events) are the SOURCE OF TRUTH46 - Content outside these tables in reference files is explanatory only47 - Do NOT extend beyond what appears in the reference file tables48 49- **AUDIT YOUR GENERATION:**50 - Before providing any code, verify EVERY API used appears in a reference file table51 - Document which reference file each API comes from52 - If you cannot cite a reference file table entry, DELETE that code53 54- **This is a CRITICAL REQUIREMENT.** Violations compromise the skill's integrity and reliability.55 56#### Step 1 — Detect the Application Type *(REQUIRED - DO NOT SKIP)*5758- **Use file_search and read_file tools to inspect workspace project files:**59 - `package.json` (project configuration and dependencies)60 - `vite.config.js` or `vite.config.ts` (Vue 3 Vite build config)61 - `vue.config.js` (Vue 2 Vue-CLI config)62 - `App.vue` (root component)63 - `main.js` or `main.ts` (app entry point — check for `Vue.use(...)` for Vue 2 vs `createApp(...)` for Vue 3)64 - Any existing `.vue` files in `src/` folder65- **Output:** Confirm the detected application type is Vue 2 or Vue 3 before proceeding, as the component registration and API patterns differ.6667#### Step 2 — Generate Code from Reference Files Only *(REQUIRED)*6869- **Before generating:** Confirm that Step 1 is complete70- Read the relevant `references/*.md` file(s) for the requested feature71- Cross-reference EVERY API, property, and method against these tables72- **COMPONENT-BASED APPROACH (MANDATORY - VUE PATTERNS ONLY):**73 - Use Vue SFC (`.vue`) syntax with `<template>`, `<script>`, and `<style>` sections74 - Use `<ejs-pdfviewer>` as the component tag75 - Bind all PDF Viewer properties using Vue's `:prop="value"` binding syntax76 - **Vue 2:** Register component via `components: { "ejs-pdfviewer": PdfViewerComponent }` and inject services via `provide: { PdfViewer: [...] }`77 - **Vue 3 Composition API:** Import `PdfViewerComponent as EjsPdfviewer` and use `provide('PdfViewer', [...])` from `vue`78 - **Vue 3 Options API:** Use `components` + `provide` options just like Vue 2 but with `createApp` entry79 - Use `ref` / `$refs` (Vue 2) or `ref()` + template `ref` attribute (Vue 3) for programmatic viewer access80- **MANDATORY:** Before generating ANY code, verify that reference files exist and are accessible81- **Read the appropriate reference file(s)** for the requested feature:82 - Use `read_file` tool on relevant `references/*.md` files83 - Confirm file contains Methods/Properties/Events tables84 - Verify tables are complete and readable85- **If reference file is missing or cannot be read:**86 - STOP code generation87 - Respond: "Reference file for this feature is not available. Please ensure all reference files are present in the `references/` directory."88 - List the missing reference file name89- **This is a BLOCKER step:** Cannot proceed without reference file validation90- If an API/property does NOT appear in the reference file table, DO NOT USE IT91- Do NOT invent, guess, or suggest any API, method, property, class, or namespace not explicitly present in the reference files92 93---9495## Reference File Routing 9697All templates and operation snippets live in `references/*.md`. Each file is a focused snippet or template the agent will combine when generating samples.9899**Flow:** Always start with [getting-started.md](references/getting-started.md), then merge matched features into its anchors (PROPS, EVENTS, UI_BUTTONS, HANDLERS). If no keyword matches, return only the basic sample.100101### Checklist Before Generating Code102103- [ ] **Detected Vue version?** Vue 2 → use `data()` + `provide:{}` | Vue 3 → use `ref()`/`reactive()` + `provide()`104- [ ] **Count the settings properties:** 1-3? → Use inline binding | 4+? → Use data constant105- [ ] **Are enums involved?** Yes → Import required enums | No → Skip enum imports106- [ ] **Is it reused elsewhere?** Yes → Use data/ref constant | No → Prefer inline107- [ ] **Is the component prop simple enough?** Yes → Keep inline | No → Extract to data/ref108109### 🎯 Core Setup & Configuration110111| File | Purpose | **Route When User Asks About** |112|---|---|---|113| [getting-started.md](references/getting-started.md) | Minimal PDFViewer with documentPath, height, and width. Base template for all samples. | "basic setup", "minimal example", "getting started", "how to load PDF" |114| [general-properties.md](references/general-properties.md) | Configure core viewer properties (server URL, document path, locale, resource base path). | "configuration", "server settings", "locale", "document path setup" |115| [enable-properties.md](references/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" |116117### 📐 Navigation & Page Management118119| File | Purpose | **Route When User Asks About** |120|---|---|---|121| [page-navigation.md](references/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" |122| [bookmark-navigation.md](references/bookmark-navigation.md) | Navigate using PDF bookmarks/table of contents in the bookmark panel. **CRITICAL: All bookmark methods MUST be accessed via `this.$refs.pdfViewer.bookmark.*` (Vue 2) or `pdfViewerRef.value.bookmark.*` (Vue 3 Composition API), NOT directly on the viewer instance.** | "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" |123| [hyperlink-navigation.md](references/hyperlink-navigation.md) | Configure hyperlink navigation behavior and external link handling in PDFs. | "hyperlinks", "external links", "URL navigation", "clickable links", "url", "link" |124| [thumbnail-navigation.md](references/thumbnail-navigation.md) | Display and navigate using page thumbnails in the thumbnail panel. | "thumbnails", "preview pages", "thumbnail panel", "thumbnail", "page previews" |125126### 🔍 Viewing & Interaction127128| File | Purpose | **Route When User Asks About** |129|---|---|---|130| [magnification.md](references/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" |131| [interaction-mode.md](references/interaction-mode.md) | Switch between Selection mode (text selection) and Panning mode (touch scrolling). | "text selection", "panning", "scroll mode", "interaction mode", "touch navigation" |132| [text-selection.md](references/text-selection.md) | Enable text selection, copying text, and text selection events. | "select text", "copy text", "highlight text to copy", "text selection mode" |133| [text-search.md](references/text-search.md) | Implement text search functionality with search options and navigation. | "search text", "find in PDF", "search functionality", "highlight search results" |134135### 🛠️ Toolbar & Context Menu136137#### Toolbar Configuration138139| File | Purpose | **Route When User Asks About** |140|---|---|---|141| [toolbar-settings.md](references/toolbar-settings.md) | Configure toolbar visibility, tooltip behavior, and customize/remove toolbar items. | "customize toolbar", "hide toolbar items", "remove toolbar buttons", "toolbar configuration" |142| [toolbar-methods.md](references/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" |143144##### ⚠️ STRICT VALIDATION FOR TOOLBAR ITEM NAMES145146**When generating toolbar configurations, you MUST follow these rules to prevent incorrect toolbar item names:**1471481. **ALWAYS reference exact item names from `toolbar-settings.md`**149 - Do NOT invent, guess, or assume toolbar item names150 - Do NOT apply naming pattern logic to derive names151 - Use ONLY names listed in the "Available Primary Toolbar Items", "Available Annotation Toolbar Items", and "Available Form Designer Items" sections in `toolbar-settings.md`1521532. **VALIDATE item names character-by-character**154 - Case sensitivity matters: `HighlightTool` ≠ `HighlightOption`155 - Exact names only: `AnnotationEditTool` ≠ `AnotatetionEditTool`156 - No abbreviations or shortcuts1571583. **Before generating toolbar configuration code:**159 - [ ] Open `toolbar-settings.md` reference file160 - [ ] Locate: "Available Primary Toolbar Items" section161 - [ ] Locate: "Available Annotation Toolbar Items" section162 - [ ] Locate: "Available Form Designer Items" section163 - [ ] Copy exact names from THESE SECTIONS ONLY164 - [ ] Cross-check every single item name character-by-character165 - [ ] If ANY item name is not in the reference sections, DO NOT USE IT166 - [ ] Consult the "❌ COMMON MISTAKES TO AVOID" table in `toolbar-settings.md` if unsure1671684. **Common errors to prevent:**169 - ❌ `AnotatetionEditTool` → ✅ `AnnotationEditTool` (typo)170 - ❌ `CalibrationOption` → ✅ `CalibrateTool` (wrong suffix)171 - ❌ `ShapeAnnotationOption` → ✅ `ShapeTool` (annotation toolbar version)172 - ❌ `InkAnnotationOption` → ✅ `InkAnnotationTool` (annotation toolbar version)173 - For complete list of mistakes to avoid, see `toolbar-settings.md` "❌ COMMON MISTAKES TO AVOID" table174175#### Context Menu Customization176177| File | Purpose | **Route When User Asks About** |178|---|---|---|179| [contextmenu.md](references/contextmenu.md) | Customize context menu items and handle context menu events. | "right-click menu", "context menu", "custom context menu", "disable context menu items" |180181### 📝 Annotations182183| File | Purpose | **Route When User Asks About** |184|---|---|---|185| [annotation-settings.md](references/annotation-settings.md) | Configure annotation appearance (colors, opacity, styles) and behavior for all annotation types. | "annotation colors", "annotation styles", "customize annotation appearance", "annotation defaults" |186| [annotation-events.md](references/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" |187| [shape-label-settings.md](references/shape-label-settings.md) | Customize shape and measure annotation labels (position, color, font, visibility). | "annotation labels", "shape labels", "measurement labels", "label customization" |188| [redaction-annotation.md](references/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" |189190### 📄 Forms191192| File | Purpose | **Route When User Asks About** |193|---|---|---|194| [form-field-settings.md](references/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" |195| [form-field-events.md](references/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" |196197### 📋 Document Actions198199| File | Purpose | **Route When User Asks About** |200|---|---|---|201| [download.md](references/download.md) | Enable/configure PDF download functionality with custom filenames. | "download PDF", "save PDF", "export document", "download button" |202| [print.md](references/print.md) | Configure and trigger PDF printing functionality. | "print PDF", "print document", "printing options", "print button" |203| [organize-pages.md](references/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" |204205### ⚙️ Advanced Features206207| File | Purpose | **Route When User Asks About** |208|---|---|---|209| [api-methods.md](references/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" |210| [events.md](references/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" |211212## Quick Start Example213214```vue215<template>216 <ejs-pdfviewer217 ref="pdfViewer"218 :resourceUrl="resourceUrl"219 :documentPath="documentPath"220 style="height: 640px">221 </ejs-pdfviewer>222</template>223224<script setup>225import { provide } from 'vue';226import { PdfViewerComponent as EjsPdfviewer, Toolbar, Magnification, Navigation, LinkAnnotation,227 BookmarkView, ThumbnailView, Print, TextSelection, TextSearch,228 Annotation, FormDesigner, FormFields } from '@syncfusion/ej2-vue-pdfviewer';229230const resourceUrl = window.location.origin + "/asset/ej2-pdfviewer-lib";231const documentPath = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf';232233provide('PdfViewer', [ Toolbar, Magnification, Navigation, LinkAnnotation, BookmarkView, ThumbnailView,234 Print, TextSelection, TextSearch, Annotation, FormDesigner, FormFields ]);235</script>236237<style>238 /* Refer to the CSS Configuration section for the full import list */239 @import '../node_modules/@syncfusion/ej2-pdfviewer/styles/material.css';240</style>241```242243## ⚙️ SETTINGS CONFIGURATION BEST PRACTICES244245**When generating code with settings (toolbarSettings, annotationSettings, annotationSelectorSettings, arrowSettings, rectangleSettings, etc.), follow these guidelines to prevent unnecessary complexity:**246247### Rule 1: Simple Settings → Define INLINE in Component Binding248249**Use this approach when:**250- Configuring only 1-3 properties251- Settings are straightforward without complex enums or custom types252- No need for separate data constants253254**Example (DO THIS):**255```vue256<template>257 <ejs-pdfviewer258 id="container"259 documentPath="https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf"260 :annotationSelectorSettings="{261 selectionBorderColor: '#0000ff',262 selectionBorderThickness: 2,263 resizerBorderColor: '#ff0000',264 }"265 style="height: 640px"266 />267</template>268```269270**Benefits:**271- ✅ No extra data properties needed272- ✅ Simple and readable273- ✅ Less code clutter274275---276277### Rule 2: Complex Settings → Define in `data()` / `ref()` (OUTSIDE template)278279**Use this approach when:**280- Configuring 4+ properties OR multiple related settings281- Using enums or complex configurations282- Need to reuse the same configuration across multiple components283284**Example — Vue 2 Options API (DO THIS ONLY FOR COMPLEX CASES):**285286```vue287<template>288 <ejs-pdfviewer289 id="container"290 :documentPath="documentPath"291 :annotationSelectorSettings="annotationSelectorConfig"292 style="height: 640px"293 />294</template>295296<script>297import { PdfViewerComponent, Annotation,298 AnnotationResizerLocation, CursorType } from '@syncfusion/ej2-vue-pdfviewer';299300export default {301 name: 'App',302 components: { 'ejs-pdfviewer': PdfViewerComponent },303 data() {304 return {305 documentPath: 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf',306 annotationSelectorConfig: {307 selectionBorderColor: '#0000ff',308 selectionBorderThickness: 2,309 resizerBorderColor: '#ff0000',310 resizerFillColor: '#4070ff',311 resizerSize: 8,312 resizerShape: 'Square',313 selectorLineDashArray: [5, 6],314 resizerLocation: AnnotationResizerLocation.Corners | AnnotationResizerLocation.Edges,315 resizerCursorType: CursorType.grab,316 },317 };318 },319 provide: { PdfViewer: [Annotation] },320};321</script>322```323324**Example — Vue 3 Composition API (DO THIS ONLY FOR COMPLEX CASES):**325326```vue327<script setup>328import { provide } from 'vue';329import { PdfViewerComponent as EjsPdfviewer, Annotation,330 AnnotationResizerLocation, CursorType } from '@syncfusion/ej2-vue-pdfviewer';331332const documentPath = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf';333const annotationSelectorConfig = {334 selectionBorderColor: '#0000ff',335 selectionBorderThickness: 2,336 resizerBorderColor: '#ff0000',337 resizerFillColor: '#4070ff',338 resizerSize: 8,339 resizerShape: 'Square',340 selectorLineDashArray: [5, 6],341 resizerLocation: AnnotationResizerLocation.Corners | AnnotationResizerLocation.Edges,342 resizerCursorType: CursorType.grab,343};344345provide('PdfViewer', [Annotation]);346</script>347```348349**When to import enums:**350- [ ] Import any enums that are used in the settings (e.g., `AnnotationResizerLocation`, `CursorType`)351- [ ] Keep imports minimal — import ONLY what is used in the settings352353**Benefits:**354- ✅ Proper enum usage355- ✅ Reusable across multiple components356- ✅ Clean template code357358---359360### Rule 3: NEVER Over-Engineer Simple Cases361362**❌ DO NOT DO THIS (Over-engineered):**363```vue364<script>365import { PdfViewerComponent } from '@syncfusion/ej2-vue-pdfviewer';366export default {367 components: { 'ejs-pdfviewer': PdfViewerComponent },368 data() {369 return {370 // Unnecessary data property for 1 simple prop371 toolbarSettings: { showTooltip: true },372 };373 },374};375</script>376```377378**✅ DO THIS INSTEAD (Simple & Clean):**379```vue380<ejs-pdfviewer :toolbarSettings="{ showTooltip: true }" ... />381```382383---