> 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/full-api/full-api-overview.md).

# WebViewer Full API Overview

Learn how to enable Apryse's Full API for WebViewer using JavaScript. Provides basic document viewing, basic PDF manipulation and cross-platform document processing API.

WebViewer's [standard API](/web/what-is-webviewer/usage.md) provides document viewing and basic PDF manipulation APIs, but doesn't provide more advanced document processing APIs.

Apryse provides a [cross platform document processing API](/core/get-started/readme.md) and the WebViewer full API is the in-browser JavaScript implementation of this. The Apryse C++ SDK is converted to a [WebAssembly](https://webassembly.org/) module allowing the same APIs to be used directly in the browser. Tasks that previously would have required a server can now be done completely client side.

See the [full API samples](/web/get-started/guides/samples/full-apis.md) for an example of this functionality.

## How to enable

When using the [default WebViewer UI](/web/ui-customization/modular-ui/getting-started.md) you can enable the full API by passing the `fullAPI` option into the WebViewer constructor which will initialize the appropriate web workers. This will make the [`PDFNet`](https://sdk.apryse.com/api/web/Core.PDFNet.html)[ namespace](https://sdk.apryse.com/api/web/Core.PDFNet.html) available on the WebViewer instance and allow you to access a [PDFDoc instance from the WebViewer document object](https://sdk.apryse.com/api/web/Core.Document.html#getPDFDoc__anchor).

{% tabs %}
{% tab title="JavaScript (SDK v8.0+)" %}

<pre class="language-js" data-line-numbers><code class="lang-js">WebViewer({
  licenseKey: '<code class="expression">visitor.claims.wvKey || "YOUR_LICENSE_KEY"</code>',
  initialDoc: 'YOUR_FILE.pdf',
  fullAPI: true
}, viewerElement).then(async instance => {
  // PDFNet is only available with full API enabled
  const { PDFNet, documentViewer } = instance.Core;

  // Start the full workers
  await PDFNet.initialize();

  documentViewer.addEventListener('documentLoaded', async () => {
    const pdfDoc = await documentViewer.getDocument().getPDFDoc();
    // access additional functionality on the PDFDoc object
    // e.g. await pdfDoc.flattenAnnotations(...)
  });
})
</code></pre>

[DocumentViewer.getDocument](https://sdk.apryse.com/api/web/Core.DocumentViewer.html#getDocument__anchor) [Document.getPDFDoc](https://sdk.apryse.com/api/web/Core.Document.html#getPDFDoc__anchor) [PDFNet.PDFDoc](https://sdk.apryse.com/api/web/Core.PDFNet.PDFDoc.html) [PDFNet](https://sdk.apryse.com/api/web/Core.PDFNet.html)
{% endtab %}

{% tab title="JavaScript (SDK v6.0+)" %}

<pre class="language-js" data-line-numbers><code class="lang-js">WebViewer({
  licenseKey: '<code class="expression">visitor.claims.wvKey || "YOUR_LICENSE_KEY"</code>',
  initialDoc: 'YOUR_FILE.pdf',
  fullAPI: true
}, viewerElement).then(async instance => {
  // PDFNet is only available with full API enabled
  const { PDFNet, docViewer } = instance;

  // Start the full workers
  await PDFNet.initialize();

  docViewer.on('documentLoaded', async () => {
    const pdfDoc = await docViewer.getDocument().getPDFDoc();
    // access additional functionality on the PDFDoc object
    // e.g. await pdfDoc.flattenAnnotations(...)
  });
})
</code></pre>

[DocumentViewer.getDocument](https://sdk.apryse.com/api/web/Core.DocumentViewer.html#getDocument__anchor) [Document.getPDFDoc](https://sdk.apryse.com/api/web/Core.Document.html#getPDFDoc__anchor) [PDFNet.PDFDoc](https://sdk.apryse.com/api/web/Core.PDFNet.PDFDoc.html) [PDFNet](https://sdk.apryse.com/api/web/Core.PDFNet.html)
{% endtab %}
{% endtabs %}

#### Working without Viewer?

You can also load it without a viewer by including the `PDFNet.js` script along with `webviewer-core.min.js` directly in your page. See [this guide](/web/get-started/without-viewer.md) for more details.

## Using the Full API with WebViewer Server

The full worker (full API) operates on a locally, loaded document that it can access, but what happens when the document is loaded on the server? In this case, the full API is not available since the document is actually loaded on the server. If the `fullAPI` option is passed, then WebViewer will automatically switch to client side document handling after the initial load of the document and you will have access to the full API at that point.

{% tabs %}
{% tab title="JavaScript (SDK v8.0+)" %}

<pre class="language-js" data-line-numbers><code class="lang-js">WebViewer({
  licenseKey: '<code class="expression">visitor.claims.wvKey || "YOUR_LICENSE_KEY"</code>',
  initialDoc: 'YOUR_FILE.pdf',
  wvServerURL: 'https://myserver:8090/',
  fullAPI: true,
}, viewerElement).then(async instance => {
  // PDFNet is only available with full API enabled
  const { PDFNet, documentViewer } = instance.Core;

  // Start the full workers
  await PDFNet.initialize();
})
</code></pre>

{% endtab %}

{% tab title="JavaScript (SDK v6.0+)" %}

<pre class="language-js" data-line-numbers><code class="lang-js">WebViewer({
  licenseKey: '<code class="expression">visitor.claims.wvKey || "YOUR_LICENSE_KEY"</code>',
  initialDoc: 'YOUR_FILE.pdf',
  wvServerURL: 'https://myserver:8090/',
  fullAPI: true,
}, viewerElement).then(async instance => {
  // PDFNet is only available with full API enabled
  const { PDFNet, docViewer } = instance;

  // Start the full workers
  await PDFNet.initialize();
})
</code></pre>

{% endtab %}
{% endtabs %}

The trade-offs with enabling the full API still exist (see next section), except you still gain the benefits of WebViewer Server performing the initial rendering of the loaded document.

## What are the tradeoffs of enabling it?

The reason why the full API isn't enabled by default is that the full API WebAssembly module is \~2-3 times larger than the default client-side module that only supports rendering. This means that it will take longer to download and process, affecting the WebViewer start up time.

If you don't require any of these APIs then it doesn't make sense to load the full API and have a slower start up time. If you are only viewing and annotating documents then you most likely do not need to enable the full API.

## Recommended browsers and devices

Although the full API will run on any browser or device, the performance may not be acceptable on mobile devices and older browsers like IE11. If you need to support these browsers or devices we recommend using a [custom server](/web/custom-server/custom-server-deployment.md) and performing the processing on the server side.

## How it works behind the scenes

You can load the full API with or without the default viewer. With the default UI you can manipulate the document using the `PDFNet` APIs and then refresh it in the viewer. Alternatively you can process a document in the background without rendering pages at all.

### Without a viewer

`webviewer-core.min.js` and `PDFNet.js` are loaded directly inside your web app when the WebViewer constructor is called. They are the core files that allow WebViewer to function. See [this guide](/web/get-started/without-viewer.md) for more details on how to use these files to run WebViewer without the viewer UI.

![](https://3532544125-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FX9YnTSKIHvV7m0A36LbO%2Fuploads%2Fgit-blob-6af06267af393063ff068cf1f11bf7cba303f52d%2F626880fc4f9a1a7c504cd5a9fb8e93d4751703ae-934x508.png?alt=media)

### With the default UI

Below is an expanded diagram of the default UI that shows the how the full API is loaded when running with the viewer. For more information, read about running with the default viewer and [how the default UI works behind the scenes](/web/ui-customization/modular-ui/getting-started.md#how-it-works-behind-the-scenes).

![](https://3532544125-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FX9YnTSKIHvV7m0A36LbO%2Fuploads%2Fgit-blob-be611fc082718304bc9a3874ebfdec9a15af63bc%2F44962dbf5050f62d1e1c00f505ddae9617a8aa59-1402x822.png?alt=media)


---

# 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/full-api/full-api-overview.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.
