For the complete documentation index, see llms.txt. This page is also available as Markdown.

Build UI-free document processing workflows with Apryse WebViewer SDK

This guide shows how to use the Apryse WebViewer SDK for headless, programmatic document processing without rendering the WebViewer UI. This approach is useful when you need to process, convert, or inspect documents directly in your application, or build automated document workflows.

The examples use a simple HTML‑based project to focus on core SDK functionality without UI components. By the end, you’ll be able to:

  • Count the number of pages in a PDF.

  • Convert a DOCX file to PDF and automatically download it.

Prerequisites

Before you start:

  • Install Node.js and npm. We recommend using the latest active LTS release.

  • Install Visual Studio Code or another code editor to develop and debug your code.

  • Get your Apryse trial key.

spinner

1. Create your project

Set up your project by creating a folder and preparing a workspace for building document‑processing workflows with the Apryse WebViewer SDK.

  1. In your terminal, go to the directory where you want to create the project.

  2. Create a new project folder and move to it so you can start working with it:

mkdir webviewer-no-ui
cd webviewer-no-ui

2. Download WebViewer

In this step, you’ll manually download the WebViewer package and add it to your project.

  1. Download the WebViewer package, which includes the library files, samples, and documentation.

  2. Extract the downloaded WebViewer.zip file into the webviewer-no-ui project folder. Your project structure should look similar to this:

3. Create the PDF viewer

In this section, you’ll add a minimal HTML structure and the JavaScript required to run document processing tasks with the Apryse WebViewer SDK. In this headless setup, only the core SDK scripts are loaded, and document workflows are handled entirely through code rather than a full viewer UI.

  1. Open the webviewer-no-ui folder in Visual Studio Code.

  2. Create a new index.html file in the webviewer-no-ui folder.

  3. Add the following HTML to the index.html file:

Info

WebViewer Core provides the foundation for WebViewer functionality. In a typical UI setup, you would include the webviewer.min.js script. In a headless (no‑UI) scenario, you only need to load the core libraries: webviewer-core.min.js and PDFNet.js.

If you don’t require advanced PDFNet functionality, you can use the lighter PDFNetLean.js script instead. It has a smaller footprint, loads faster, and includes the essential PDFNet features without requiring the full API. For this guide, we use the full PDFNet.js library for consistency, though it's not required.

  1. Add the following JavaScript to your index.html file, placing it before the closing </body> tag:

  1. Save the index.html file.

4. Verify your output

Once your project files are in place, serve the webpage so that the Apryse WebViewer SDK can load and run document-processing tasks in the browser. This allows you to verify that your setup is working correctly. We use http-server to preview the page locally in your browser.

  1. From your project directory, run the following command to start a local web server:

If prompted, press y to install http-server. A successful output looks similar to:

  1. Open the localhost URL from your terminal to view the project in your browser.

  2. Paste this URL into your browser to see an alert showing the PDF's page count, then load the page:

  1. Paste this URL into your browser to convert the DOCX file to PDF and automatically download the result, then load the page:

Get started video

In this 6-minute video, learn how to integrate the Apryse WebViewer SDK into your application and build document-processing workflows without a viewer interface.

Integrate the WebViewer SDK without the UI to build document-processing workflows.

Next steps

UsageGuidesSamplesAPI docs

Last updated

Was this helpful?