SDK Samples

Web SDK

In-browser PDF viewing, annotations, forms, signatures, and redaction. 37 samples spanning every major UI surface.

38 samples10 categoriesProduct home →Guides →
AI assistants

Wire up @nutrient-sdk/viewer-mcp — an MCP server that gives AI assistants live access to Web SDK docs, API, examples, and changelog. Add it to your MCP client config:

MCP client config
{
  "mcpServers": {
    "Nutrient": { "command": "npx", "args": ["@nutrient-sdk/viewer-mcp"] }
  }
}

Prefer agent skills? Follow the Web SDK agent skill guide to install Nutrient skills directly into your coding agent.

01

Annotation Permissions

Role-based annotation permissions with a teacher/student classroom model — toggle visibility per student

Annotations
02

Annotation Presets

Customize default properties for annotation tools including colors, sizes, fonts, and line styles with live preview

Annotations
03

Annotation State Management

Save and restore annotation states locally with version control-like functionality for managing document changes

Annotations
04

Bookmark & Outline Navigation

Browse the document's table of contents and bookmarks in a custom sidebar with click-to-navigate

User Interface
05

Brightness & Contrast

Bidirectional slider to brighten dark or poorly-scanned documents, or enable night mode for comfortable dark reading

User Interface
06

Collaboration Comments

Threaded comment replies with author tracking, @mentions, and configurable display modes (Fitting, Floating, Popover)

Annotations
07

Content Editing API

Advanced content editing with text detection, find & replace, and AI text generation

Content Editor
08

Counting Annotations

Click anywhere on a document to place numbered markers using custom-rendered annotations with a sidebar tracker

Annotations
09

Construction Measurement

Measure distances on a construction floor plan by dropping two pins. The measurement line and its live distance label update as you drag either pin.

Annotations
10

Cross-Page Text Comparison

Extract and compare full document text across page boundaries with visual diff highlighting and change navigation

Document Comparison
11

Custom Menu Interface

A completely custom menu interface with custom toolbar, annotation tools, document comparison, and measurement capabilities

User Interface
12

Custom Renderers

Creative custom annotation renderers showcasing visual effects, animations, interactive widgets, and more

Annotations
13

Custom UI Form Creator

Build custom form builder UI by hiding SDK defaults and replacing with your own components

Forms
14

Document AssemblyWIP

Assemble documents by dragging pages between two panels with multi-select, reorder, rotate, duplicate, delete, upload, and export

Document Editor
15

Document Loading Methods

Demonstrate all supported document loading methods: URL, ArrayBuffer, Blob, and Base64. Includes file upload with method selection

User Interface
16

Document Markup Modes

View Word documents with tracked changes and comments in different markup modes: no markup, original, simple markup, and all markup

Document Conversion
17

Document Search

Search through PDF documents with context-aware results, instant highlighting, and automatic navigation to matches

User Interface
18

Form Data Pre-Fill

Programmatically populate PDF form fields from JSON data presets with editable field values and apply/clear controls

Forms
19

Form Designer

Drag and drop form fields onto PDF documents with an intuitive form creator mode for building interactive forms

Forms
20

Form Validation

Client-side validation rules with visual feedback on PDF form fields using a declarative rule engine

Forms
21

Grouped Form Fields

Drag and drop grouped form fields with image backgrounds, company logos, checkboxes, signatures, and date fields. Moving or deleting any element affects the entire group.

Forms
22

Indexed Cross-Document Search

Search a corpus of mixed PDFs and Office documents using a prebuilt full-text index, then jump straight to the matching page in the viewer with the term highlighted

User Interface
23

Indexed Cross-Document Search (Server-Side)

Same cross-document search, but with the index in Postgres and queries served by an API route. Demonstrates the production path beyond a static JSON dump

User Interface
24

Keyword Highlight

Automatically search and highlight configurable keywords in a document with color-coded annotations

Annotations
25

Layer Management

Toggle PDF layer groups (OCGs) to show or hide building systems on a construction floor plan with quick presets

User Interface
26

Multi-Document Tabs

View multiple PDF documents in a tabbed interface with page position memory, closeable tabs, and file upload

User Interface
27

Night Mode

Toggle night mode in the PDF viewer with a custom toolbar button using CSS filter inversion

User Interface
28

Numbered Callouts

Bluebeam/Procore-style numbered bubble + leader arrows for construction punch lists, with a live legend sidebar

Annotations
29

Patient Intake Forms

Digital patient check-in with smart form pre-population, progressive form completion, and HIPAA-compliant data handling

Forms
30

Search & Redact

Permanently redact sensitive information using preset PII patterns (SSN, credit card, email, phone), custom text terms, or regular expressions

Redaction
31

Simple Signing Demo

Complete signature workflow with drag-and-drop field placement, electronic signatures, role-based permissions, signature flattening, and a visible digital signature on an appended certificate page via DWS API

Signatures
32

Slot UI Customization

Custom sidebar, comment badges, and interactive slot actions — demonstrating the Nutrient Web SDK slot UI customization API

User Interface
33

Text Comparison

Side-by-side PDF comparison with synchronized viewing and interactive change tracking

Document Comparison
34

Hybrid Comparison

Compare a document pair visually (overlay) and textually at once, with auto-highlighted changes and reviewer markup on both views

Document Comparison
35

Hybrid Comparison — Custom Overlay

Single-view comparison where each text change is a custom-overlay callout pinned to its location, showing the before → after value

Document Comparison
36

Text Extraction

Extract text from PDF pages with current-page or full-document view, copy to clipboard, and download as plain text

Content
37

Watermark

Add configurable text watermarks to every page with customizable text, font size, color, opacity, and rotation

Document Editor
38

Zoom Level Display

Display the current zoom level as a percentage in a custom toolbar button with click-to-reset functionality

User Interface