Some test text!

Loading...
Guides
Standard API

Standard API for WebViewer

WebViewer provides a standard API that works the same way for any of the deployment options . This allows you to easily try out different WebViewer deployment options with minimal code changes.

WebViewer instance

The WebViewer initializer gives you an instance object that provides a number of functions and objects. All of the APIs available here (with a few exceptions) are considered the standard WebViewer API.

The standard API is a combination of the default WebViewer UI APIs and the WebViewer Core APIs.

WebViewer({
  // options here
}, document.getElementById('viewer'))
  .then(instance => {
    // common properties and functions you might use

    // WebViewer UI APIs
    instance.UI.setHeaderItems(...);
    instance.UI.searchText(...);

    // WebViewer Core APIs
    const documentViewer = instance.Core.documentViewer;
    documentViewer.getPageCount();
    const doc = documentViewer.getDocument();
    const annotManager = instance.annotManager;
    annotManager.getAnnotationsList();

    const { Tools, Annotations } = instance.Core;
  });

Exceptions

The PDFNet property on the instance is the main exception and is also known as the full API. See this guide for more information about what it is and why you might want to use it.

The permanent page manipulation APIs on the Document object and the applyRedactions function on AnnotationManager are only available in client only mode or with WebViewer Server. To achieve similar functionality with a custom server you would do the processing on the server side and reconvert the file.

Get the answers you need: Support

UPCOMING WEBINAR: Live tech update and run-through. October 21 @ 11am PDT