Some test text!

menu
search

Standard API

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.

linkWebViewer 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(function(instance) {
    // common properties and functions you might use

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

    // WebViewer Core APIs
    var docViewer = instance.docViewer;
    docViewer.getPageCount();
    var doc = docViewer.getDocument();
    var annotManager = instance.annotManager;
    annotManager.getAnnotationsList();

    var CoreControls = instance.CoreControls;
    var Tools = instance.Tools;
    var Annotations = instance.Annotations;
  });

linkExceptions

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

close

Free Trial

Get unlimited trial usage of PDFTron SDK to bring accurate, reliable, and fast document processing capabilities to any application or workflow.

Select a platform to get started with your free trial.

Unlimited usage. No email address required.

PDFTron Receives USD$71 Million Growth Investment Led By Silversmith Capital Partners

Learn more
close