Some test text!

Loading...
Guides
Lower level document APIs

Loading and rendering documents without using WebViewer UI

It's common to use the built in WebViewer UI to view and interact with documents, however it's also possible to load documents and render pages without using the UI. By using the lower level Document class, you can load documents in memory and have full control over how the pages are laid out, or use non-viewing APIs like extracting text.

Create documents

You can use the Core.createDocument API to instantiate documents from different sources, for example URLs or blobs.

Below are some examples of creating commonly used documents:

Create XOD document
To create a XOD document.

Create PDF document
To create a PDF document.

Create an Office document
To create an Office document.

Render pages

After the document has been created, use the loadCanvasAsync API to render a page on a canvas. You have full control of how the pages are rendered by passing different values to this API.

doc.loadCanvasAsync({
  pageNumber: 1, // Render the first page
  zoom: 1, // 100% zoom level
  pageRotation: Core.PageRotation.e_0, // 0 degree rotation
  drawComplete: canvas => {
    // The canvas that contains the first page
    console.log(canvas);
  }
})

Load page text

Text extraction
To extract text in the document without rendering it using loadPageText API.

More APIs

Get the answers you need: Support

UPCOMING WEBINAR: "2021 in review: Top five new & updated features" Dec 9th @ 11am PT