/syncfusion-pdf-viewer-sdk:syncfusion-javascript-pdf-viewerfrom Syncfusion PDF Viewer SDK
Implements the Syncfusion Javascript (ES6) is case-sensitive PDF Viewer (PdfViewer) for embedding, configuring, and loading PDF documents. Use this when rendering PDFs in a TypeScript application using the EJ2 class-based approach, embedding viewer controls, or generating TypeScript and HTML code for PDF display and interaction.
Ships in Syncfusion PDF Viewer SDK. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Trigger keywords: "how to", "add pdfviewer", "code sample", "show me", "example", "snippet", "integrate", "component", "create sample", "typescript sample".
Purpose: Generate minimal, copy-pasteable TypeScript (.ts) and HTML code that the user can integrate directly into their TypeScript EJ2 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:
STRICT ENFORCEMENT - ZERO TOLERANCE:
MANDATORY RESPONSE FOR UNSUPPORTED FEATURES:
"This feature is not supported in the current Syncfusion TypeScript PDF Viewer implementation."
REFERENCE FILE HIERARCHY:
AUDIT YOUR GENERATION:
This is a CRITICAL REQUIREMENT. Violations compromise the skill's integrity and reliability.
package.json (check for @syncfusion/ej2-pdfviewer or @syncfusion/ej2 dependency)tsconfig.json (TypeScript configuration)webpack.config.js (EJ2 quickstart uses webpack)src/index.ts or src/app.ts (main TypeScript entry point)src/index.html (HTML container file)PdfViewer class. Do NOT generate React, Angular, or Vue component code.references/*.md file(s) for the requested featurePdfViewer and required module classes from @syncfusion/ej2-pdfviewerPdfViewer.Inject(...) to inject required feature modulesnew PdfViewer({ ... }) or new PdfViewer() and set propertiesviewer.appendTo('#ElementId')<PdfViewerComponent>, <Inject services={...}>, useState, useRef, or useEffectread_file tool on relevant references/*.md filesreferences/ directory."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. If no keyword matches, return only the basic sample.
@syncfusion/ej2-pdfviewer | No → Skip enum imports@syncfusion/ej2-pdfviewer — NEVER from @syncfusion/ej2-typescript-pdfviewer| File | Purpose | Route When User Asks About |
|---|---|---|
| getting-started.md | Minimal PdfViewer setup: clone quickstart, install packages, import CSS, create PdfViewer instance with documentPath and resourceUrl, and appendTo HTML container. | "basic setup", "minimal example", "getting started", "how to load PDF" |
| general-properties.md | Configure core viewer properties (width, height, document path, locale, resourceUrl, serviceUrl, AJAX settings, scroll settings, commandManager). | "configuration", "server settings", "locale", "document path setup", "width height" |
| 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" |
| 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: Bookmark API methods are accessed on the pdfviewer instance directly (e.g., pdfviewer.bookmark.openBookmarkPane()). Requires BookmarkView to be injected and enableBookmark: true. | "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" |
| File | Purpose | Route When User Asks About |
|---|---|---|
| general-properties.md | Configure core viewer properties including isCommandPanelOpen to show/hide the comments panel programmatically. See "Controlling Command Panel (Comments Panel)" section. REQUIREMENT: Set enableAnnotation: true for the command panel to be functional. PROPERTY: isCommandPanelOpen is read/write boolean (not read-only). | "show comments panel", "hide comments panel", "toggle comments", "command panel", "show/hide comments", "isCommandPanelOpen", "comments panel", "annotation comments" |
| 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" |
| File | Purpose | Route When User Asks About |
|---|---|---|
| toolbar-settings.md | Configure toolbar visibility, tooltip behavior, and customize/remove toolbar items using toolbarSettings. | "customize toolbar", "hide toolbar items", "remove toolbar buttons", "toolbar configuration" |
| toolbar-methods.md | Programmatically show/hide toolbars and enable/disable toolbar items at runtime using methods like showToolbar(). | "show/hide toolbar dynamically", "toggle toolbar", "enable/disable toolbar items programmatically" |
When generating toolbar configurations, you MUST follow these rules to prevent incorrect toolbar item names:
ALWAYS reference exact item names from toolbar-settings.md
toolbar-settings.mdVALIDATE item names character-by-character
HighlightTool ≠ HighlightOptionAnnotationEditTool ≠ AnotatetionEditToolBefore generating toolbar configuration code:
toolbar-settings.md reference filetoolbar-settings.md if unsureCommon errors to prevent:
AnotatetionEditTool → ✅ AnnotationEditTool (typo)CalibrationOption → ✅ CalibrateTool (wrong suffix)ShapeAnnotationOption → ✅ ShapeTool (annotation toolbar version)InkAnnotationOption → ✅ InkAnnotationTool (annotation toolbar version)toolbar-settings.md "❌ COMMON MISTAKES TO AVOID" table| File | Purpose | Route When User Asks About |
|---|---|---|
| context-menu.md | Customize context menu items and handle context menu events. | "right-click menu", "context menu", "custom context menu", "disable context menu items" |
| 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" |
| File | Purpose | Route When User Asks About |
|---|---|---|
| form-field-settings.md | Configure default properties for form fields (text, checkbox, radio, dropdown, signature). Use TextFieldSettings, CheckBoxFieldSettings, RadioButtonFieldSettings, etc. for proper type casting. CRITICAL: Form field bounds use capitalized properties (X, Y, Width, Height), NOT lowercase. TIMING CRITICAL: Always add form fields inside the documentLoad event callback - calling before document loads causes "formFieldCollections is not a function" error. | "form field defaults", "form field styles", "configure form fields", "form field properties", "add text field", "add form field", "add textbox", "add checkbox", "programmatically add field", "addFormField", "TextFieldSettings" |
| 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" |
| 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" |
| 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" |
import { PdfViewer, Toolbar, Magnification, Navigation, Annotation, LinkAnnotation,
ThumbnailView, BookmarkView, TextSelection, TextSearch, FormFields, FormDesigner } from '@syncfusion/ej2-pdfviewer';
PdfViewer.Inject(Toolbar, Magnification, Navigation, Annotation, LinkAnnotation, ThumbnailView,
BookmarkView, TextSelection, TextSearch, FormFields, FormDesigner);
let pdfviewer: PdfViewer = new PdfViewer();
pdfviewer.documentPath = "https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf";
pdfviewer.resourceUrl = "https://cdn.syncfusion.com/ej2/31.1.23/dist/ej2-pdfviewer-lib";
pdfviewer.appendTo('#PdfViewer');
documentLoad EventCertain operations MUST be performed inside the documentLoad event callback, not immediately after instantiation:
Operations that REQUIRE documentLoad:
formDesigner.addFormField())annotation.addAnnotation())formFieldCollections)Operations safe at instantiation time:
enableToolbar, enableAnnotation, etc.width, height❌ WRONG - Causes "formFieldCollections.findIndex is not a function":
let pdfviewer = new PdfViewer({
documentPath: 'https://...',
resourceUrl: 'https://...'
});
pdfviewer.appendTo('#PdfViewer');
// ERROR! formFieldCollections not yet initialized
pdfviewer.formDesigner.addFormField('Textbox', { ... });
✅ CORRECT - Inside documentLoad callback:
let pdfviewer = new PdfViewer({
documentPath: 'https://...',
resourceUrl: 'https://...',
documentLoad: () => {
// SAFE - Document fully loaded, formFieldCollections initialized
pdfviewer.formDesigner.addFormField('Textbox', { ... });
}
});
pdfviewer.appendTo('#PdfViewer');
When generating code with settings (toolbarSettings, annotationSettings, annotationSelectorSettings, arrowSettings, rectangleSettings, etc.), follow these guidelines:
Use this approach when:
Example (DO THIS):
import { PdfViewer, Toolbar, Annotation } from '@syncfusion/ej2-pdfviewer';
PdfViewer.Inject(Toolbar, Annotation);
let pdfviewer: PdfViewer = new PdfViewer({
documentPath: 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf',
resourceUrl: 'https://cdn.syncfusion.com/ej2/31.1.23/dist/ej2-pdfviewer-lib',
annotationSelectorSettings: {
selectionBorderColor: '#0000ff',
resizerBorderColor: '#ff0000',
resizerSize: 8
}
});
pdfviewer.appendTo('#PdfViewer');
Benefits:
Use this approach when:
Example (DO THIS ONLY FOR COMPLEX CASES):
import { PdfViewer, Toolbar, Annotation, AnnotationResizerLocation, CursorType } from '@syncfusion/ej2-pdfviewer';
import { AnnotationSelectorSettingsModel } from '@syncfusion/ej2-pdfviewer';
PdfViewer.Inject(Toolbar, Annotation);
// Define constant OUTSIDE instantiation 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
};
let pdfviewer: PdfViewer = new PdfViewer({
documentPath: 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf',
resourceUrl: 'https://cdn.syncfusion.com/ej2/31.1.23/dist/ej2-pdfviewer-lib',
annotationSelectorSettings: annotationSelectorConfig
});
pdfviewer.appendTo('#PdfViewer');
When to import types and enums:
AnnotationSelectorSettingsModel) for TypeScript type checkingAnnotationResizerLocation, CursorType)Benefits:
❌ DO NOT DO THIS (Over-engineered):
import { PdfViewer, Toolbar } from '@syncfusion/ej2-pdfviewer';
import { ToolbarSettingsModel } from '@syncfusion/ej2-pdfviewer';
PdfViewer.Inject(Toolbar);
// Unnecessary constant for 2 simple properties
const toolbarSettings: ToolbarSettingsModel = {
showTooltip: true
};
let pdfviewer: PdfViewer = new PdfViewer({
toolbarSettings: toolbarSettings
});
pdfviewer.appendTo('#PdfViewer');
✅ DO THIS INSTEAD (Simple & Clean):
import { PdfViewer, Toolbar } from '@syncfusion/ej2-pdfviewer';
PdfViewer.Inject(Toolbar);
let pdfviewer: PdfViewer = new PdfViewer({
documentPath: 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf',
resourceUrl: 'https://cdn.syncfusion.com/ej2/31.1.23/dist/ej2-pdfviewer-lib',
toolbarSettings: { showTooltip: true }
});
pdfviewer.appendTo('#PdfViewer');
Extract Pages API location: extractPages() is a method of PdfViewer, not of pageOrganizer. Call pdfviewer.extractPages('1-3'), not pdfviewer.pageOrganizer.extractPages('1-3'). The PageOrganizer service enables the UI and capabilities, but programmatic extraction uses the viewer instance.
Loading extracted/serialized PDFs: pdfviewer.load(document, password?) accepts two parameters. When loading output returned by extractPages(...), provide the password parameter as an empty string if the document is not protected, for example: pdfviewer.load(extractedPdf, ''). Supply the actual password only for password-protected PDFs.
Event timing for document-dependent operations: Perform annotation and form field operations inside documentLoad to avoid initialization errors (e.g., formFieldCollections availability).
README.md (opens in a new tab)references/annotation-events.md (opens in a new tab)references/annotation-settings.md (opens in a new tab)references/api-methods.md (opens in a new tab)references/bookmark-navigation.md (opens in a new tab)references/context-menu.md (opens in a new tab)references/download.md (opens in a new tab)references/enable-properties.md (opens in a new tab)references/events.md (opens in a new tab)references/form-field-events.md (opens in a new tab)references/form-field-settings.md (opens in a new tab)references/general-properties.md (opens in a new tab)references/getting-started.md (opens in a new tab)references/hyperlink-navigation.md (opens in a new tab)references/interaction-mode.md (opens in a new tab)references/magnification.md (opens in a new tab)references/organize-pages.md (opens in a new tab)references/page-navigation.md (opens in a new tab)references/print.md (opens in a new tab)references/redaction-annotation.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub syncfusion/boldcreate-plugins --plugin syncfusion-pdf-viewer-sdk13 skills in this plugin
/syncfusion-angular-pdf-viewerImplements the Syncfusion Angular PDF Viewer (PdfViewerComponent) for embedding, configuring, and loading PDF documents. Use this when rendering PDFs in an Angular application, embedding viewer controls, or generating TS/CSS code for PDF display and interaction./syncfusion-aspnetcore-pdf-viewerImplements the Syncfusion ASP.NET Core PDFViewer for embedding, configuring, and loading PDF documents. Use this when rendering PDFs in ASP.NET Core applications, embedding viewer controls, or generating Razor page (.cshtml) code for PDF display and interaction./syncfusion-