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.
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.
In your terminal, go to the directory where you want to create the project.
Create a new project folder and move to it so you can start working with it:
mkdir webviewer-no-ui
cd webviewer-no-ui2. Download WebViewer
In this step, you’ll manually download the WebViewer package and add it to your project.
Download the WebViewer package, which includes the library files, samples, and documentation.
Extract the downloaded
WebViewer.zipfile into thewebviewer-no-uiproject 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.
Open the
webviewer-no-uifolder in Visual Studio Code.Create a new
index.htmlfile in thewebviewer-no-uifolder.Add the following HTML to the
index.htmlfile:
Add the following JavaScript to your
index.htmlfile, placing it before the closing</body>tag:
Save the
index.htmlfile.
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.
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:
Open the localhost URL from your terminal to view the project in your browser.
Paste this URL into your browser to see an alert showing the PDF's page count, then load the page:
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.
Next steps
Last updated
Was this helpful?