> For the complete documentation index, see [llms.txt](https://docs.apryse.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.apryse.com/web/get-started/guides/samples/full-apis.md).

# Full API samples for WebViewer

Learn how to customize document save/download, select elements in a PDF, perform complex editing, preprocess documents, compare PDFs, and more with PDFNetJS samples. The Apryse Web SDK streamlines sec

## Viewer samples

### ViewerCustomSave

This sample demonstrates how to customize document save/download. In the example annotations are flattened before saving.

<a href="https://sdk.apryse.com/samples/web/samples/full-apis/ViewerCustomSaveTest/" class="button primary">Launch demo</a><a href="/web/get-started/samples/viewercustomsavetest.md" class="button primary">View source code</a>

### ViewerDisplayPoints

This sample demonstrates how to use PDFNetJS to select elements in a PDF document. Click on an element in the PDF and it will show the element's bounding box and an outline if it is a PDF path.

<a href="https://sdk.apryse.com/samples/web/samples/full-apis/ViewerDisplayPointsTest/" class="button primary">Launch demo</a><a href="/web/get-started/samples/viewerdisplaypointstest.md" class="button primary">View source code</a>

### ViewerEdit

This sample illustrates how PDFNetJS can be used to perform complex editing on PDF documents as they are displayed in the WebViewer. Open a PDF of your choice and press the refresh button at the top right to change all text to blue and all images to red.

<a href="https://sdk.apryse.com/samples/web/samples/full-apis/ViewerEditTest/" class="button primary">Launch demo</a><a href="/web/get-started/samples/vieweredittest.md" class="button primary">View source code</a>

### ViewerPreprocess

This sample illustrates how PDFNetJS can be used to preprocess a document before displaying it with WebViewer.

<a href="https://sdk.apryse.com/samples/web/samples/full-apis/ViewerPreprocessTest/" class="button primary">Launch demo</a><a href="/web/get-started/samples/viewerpreprocesstest.md" class="button primary">View source code</a>

### ViewerPDFDiffTest

This sample illustrates how PDFNetJS can be used to compare two PDF documents and show their difference in WebViewer.

<a href="https://sdk.apryse.com/samples/web/samples/full-apis/ViewerPDFDiffTest/" class="button primary">Launch demo</a><a href="/web/get-started/samples/viewerpdfdifftest.md" class="button primary">View source code</a>

### ViewerSnapToNearestTest

This sample illustrates how to use the snap API for calculating the nearest snap point.

<a href="https://sdk.apryse.com/samples/web/samples/full-apis/ViewerSnapToNearestTest/" class="button primary">Launch demo</a><a href="/web/get-started/samples/viewersnaptonearesttest.md" class="button primary">View source code</a>

### ViewerDigitalSignatureValidationTest

This sample illustrates how PDFNetJS can be used to validate digital signatures in a document.

<a href="https://sdk.apryse.com/samples/web/samples/full-apis/ViewerDigitalSignatureValidationTest/" class="button primary">Launch demo</a><a href="/web/get-started/samples/viewerdigitalsignaturevalidationtest.md" class="button primary">View source code</a>

### ReaderModeTest

This sample demonstrates Reader Mode in WebViewer.

<a href="https://sdk.apryse.com/samples/web/samples/full-apis/ReaderModeTest/" class="button primary">Launch demo</a><a href="/web/get-started/samples/readermodetest.md" class="button primary">View source code</a>

### deck.js

This sample illustrates how PDFNetJS can be used to power deck.js slideshows in the same way WebViewer does using PDFNet rasterizing functions.

<a href="https://sdk.apryse.com/samples/web/samples/full-apis/DeckJSTest/" class="button primary">Launch demo</a>

## Console samples

### AddImage

This sample illustrates how to embed various raster image formats (e.g. TIFF, JPEG, JPEG2000, JBIG2, GIF, PNG, BMP, etc.) in a PDF document.

<a href="https://sdk.apryse.com/samples/web/samples/full-apis/AddImageTest/" class="button primary">Launch demo</a><a href="/web/get-started/samples/addimagetest.md" class="button primary">View source code</a>

### Annotation

Shows how to add a text annotation to an existing page and how to create link annotations between several pages.

<a href="https://sdk.apryse.com/samples/web/samples/full-apis/AnnotationTest/" class="button primary">Launch demo</a><a href="/web/get-started/samples/annotationtest.md" class="button primary">View source code</a>

### Bookmark

The sample code illustrates how to read and edit existing outline items and create new bookmarks using the high-level API.

<a href="https://sdk.apryse.com/samples/web/samples/full-apis/BookmarkTest/" class="button primary">Launch demo</a><a href="/web/get-started/samples/bookmarktest.md" class="button primary">View source code</a>

### ContentReplacer

The sample demonstrates replacement of objects such as images, text and strings within a document.

<a href="https://sdk.apryse.com/samples/web/samples/full-apis/ContentReplacerTest/" class="button primary">Launch demo</a><a href="/web/get-started/samples/contentreplacertest.md" class="button primary">View source code</a>

### DigitalSignature

Demonstrates how to digitally sign a PDF and also how to certify a PDF doc.

<a href="https://sdk.apryse.com/samples/web/samples/full-apis/DigitalSignaturesTest/" class="button primary">Launch demo</a><a href="/web/get-started/samples/digitalsignaturestest.md" class="button primary">View source code</a>

### ElementBuilder

Illustrates how to use PDFNet page writing API, how to embed fonts and images and how to copy graphical elements from one page to another.

<a href="https://sdk.apryse.com/samples/web/samples/full-apis/ElementBuilderTest/" class="button primary">Launch demo</a><a href="/web/get-started/samples/elementbuildertest.md" class="button primary">View source code</a>

### ElementEdit

The sample code shows how to edit the page display list and how to modify graphics state attributes on existing Elements. In particular the sample program strips all images from the page and changes text color to blue.

<a href="https://sdk.apryse.com/samples/web/samples/full-apis/ElementEditTest/" class="button primary">Launch demo</a><a href="/web/get-started/samples/elementedittest.md" class="button primary">View source code</a>

### ElementReader

Illustrates how to traverse page display list using ElementReader.

<a href="https://sdk.apryse.com/samples/web/samples/full-apis/ElementReaderTest/" class="button primary">Launch demo</a><a href="/web/get-started/samples/elementreadertest.md" class="button primary">View source code</a>

### Encryption

Demonstrates how to encrypt and decrypt files by adding or removing passwords.

<a href="https://sdk.apryse.com/samples/web/samples/full-apis/EncTest/" class="button primary">Launch demo</a><a href="/web/get-started/samples/enctest.md" class="button primary">View source code</a>

### XFDF Import

PDFNet includes full support for FDF (Forms Data Format) and the capability to merge/extract forms data (FDF) with/from PDF. The sample illustrates basic XFDF merge functionality available in PDFNet.

<a href="https://sdk.apryse.com/samples/web/samples/full-apis/FDFTest/" class="button primary">Launch demo</a><a href="/web/get-started/samples/fdftest.md" class="button primary">View source code</a>

### InteractiveForms

Illustrates how to create and edit interactive forms (check boxes and text boxes).

<a href="https://sdk.apryse.com/samples/web/samples/full-apis/InteractiveFormsTest/" class="button primary">Launch demo</a><a href="/web/get-started/samples/interactiveformstest.md" class="button primary">View source code</a>

### LogicalStructure

This sample illustrates how to traverse the structure and content of a tagged PDF document.

<a href="https://sdk.apryse.com/samples/web/samples/full-apis/LogicalStructureTest/" class="button primary">Launch demo</a><a href="/web/get-started/samples/logicalstructuretest.md" class="button primary">View source code</a>

### PDFA

This sample demonstrates PDFA verification and conversion.

<a href="https://sdk.apryse.com/samples/web/samples/full-apis/PDFATest/" class="button primary">Launch demo</a><a href="/web/get-started/samples/pdfatest.md" class="button primary">View source code</a>

### PDFDraw

This sample illustrates how to use the built-in rasterizer in order to render PDF images on the fly and how to save resulting images in PNG and JPEG format.

<a href="https://sdk.apryse.com/samples/web/samples/full-apis/PDFDrawTest/" class="button primary">Launch demo</a><a href="/web/get-started/samples/pdfdrawtest.md" class="button primary">View source code</a>

### PDFLayers

This sample demonstrates how to create PDF layers (also known as Optional Content Groups - OCGs). The sample also shows how to extract and render PDF layers.

<a href="https://sdk.apryse.com/samples/web/samples/full-apis/PDFLayersTest/" class="button primary">Launch demo</a><a href="/web/get-started/samples/pdflayerstest.md" class="button primary">View source code</a>

### PDFPage

The sample illustrates how to copy pages from one document to another, how to delete, and re-arrange pages and how to use ImportPages() method for very efficient copy and merge operations.

<a href="https://sdk.apryse.com/samples/web/samples/full-apis/PDFPageTest/" class="button primary">Launch demo</a><a href="/web/get-started/samples/pdfpagetest.md" class="button primary">View source code</a>

### PDFRedaction

The sample illustrates how to create Redaction objects and use PDFNetJS's redact function to remove and overlay PDF document content.

<a href="https://sdk.apryse.com/samples/web/samples/full-apis/PDFRedactTest/" class="button primary">Launch demo</a><a href="/web/get-started/samples/pdfredacttest.md" class="button primary">View source code</a>

### PDFRect

The sample illustrates how to translate a PDF image by extracting and manipulating the image's media box.

<a href="https://sdk.apryse.com/samples/web/samples/full-apis/RectTest/" class="button primary">Launch demo</a><a href="/web/get-started/samples/recttest.md" class="button primary">View source code</a>

### SDFTest

The sample illustrates how to extract an SDF document from a PDF document and change some of its values.

<a href="https://sdk.apryse.com/samples/web/samples/full-apis/SDFTest/" class="button primary">Launch demo</a><a href="/web/get-started/samples/sdftest.md" class="button primary">View source code</a>

### Stamper

The sample code illustrates how to stamp text and images onto various pages in a PDF document.

<a href="https://sdk.apryse.com/samples/web/samples/full-apis/StamperTest/" class="button primary">Launch demo</a><a href="/web/get-started/samples/stampertest.md" class="button primary">View source code</a>

### TextExtraction

The sample demonstrates how to extract information from text boxes such as their position, font, size, color and of course the text itself.

<a href="https://sdk.apryse.com/samples/web/samples/full-apis/TextExtractTest/" class="button primary">Launch demo</a><a href="/web/get-started/samples/textextracttest.md" class="button primary">View source code</a>

### TextSearch

The sample demonstrates how to search using strings and regular expressions in a PDF document and how to set search mode and parameters.

<a href="https://sdk.apryse.com/samples/web/samples/full-apis/TextSearchTest/" class="button primary">Launch demo</a><a href="/web/get-started/samples/textsearchtest.md" class="button primary">View source code</a>

### WebViewerConvert

The sample is using `pdftron.PDF.Convert.ToXod()` to convert/stream PDF, XPS, MS Office, RTF, HTML and other document formats to WebViewer.

<a href="https://sdk.apryse.com/samples/web/samples/full-apis/WebViewerConvertTest/" class="button primary">Launch demo</a><a href="/web/get-started/samples/webviewerconverttest.md" class="button primary">View source code</a>

### Optimizer

The sample illustrates how to reduce PDF file size using 'pdftron.PDF.Optimizer'. It also shows how to simplify and optimize PDF documents for viewing on mobile devices and on the Web using 'pdftron.PDF.Flattener'.

<a href="https://sdk.apryse.com/samples/web/samples/full-apis/OptimizerTest/" class="button primary">Launch demo</a><a href="/web/get-started/samples/optimizertest.md" class="button primary">View source code</a>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.apryse.com/web/get-started/guides/samples/full-apis.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
