Libraries and Frameworks
Integrations
The WebViewer SDK base package is robust, allowing you to do the following with PDFs inside your app:
You can also take advantage of our add-on packages for further capabilities.
Adding WebViewer to your application allows users to use PDFs without going outside of your application. This reduces reliance on third-party systems, multiple vendors, and file downloads for everyday tasks without compromising control, compliance, or security.
Interact with our showcase demo to test out all of the Apryse WebViewer SDK functionality.
This guide walks you through how to integrate the WebViewer SDK into your project. This is the guide for you if you need to add WebViewer outside of a package manager. We'll use an HTML-based project as our example project throughout this guide. By the end, you'll be able to render a PDF document in the UI.
Get started with the Apryse WebViewer SDK via manual installation video. If you wish, you may skip this section and follows the steps below to get started.
Video of how to integrate Apryse WebViewer SDK into your app through manual install.
Before you start:
Apryse collects some data regarding your usage of the SDK for product improvement.
If you wish to continue without data collection, contact us and we will email you a no-tracking trial key for you to get started.
Download the WebViewer package (contains library and samples).
Extract the WebViewer package (WebViewer.zip
) into your project folder. For this guide, we'll call our project folder manual-integration
.
1. Create a new index.html
file in your manual-integration
folder.
2. In your text editor, paste the HTML below into the index.html
file. Two essential things to take note of in the HTML are that:
webviewer.min.js
file in the WebViewer
folder in your project folder.viewer
id is where WebViewer will be mounted. In this example it also contains styling elements for the viewer, though you could do so using CSS if you prefer.You can, alternatively, import WebViewer as a CommonJS module.
Next, you'll copy and paste in the script tag that includes the WebViewer constructor.
1. Copy, then paste the script below into the index.html
file in your project after the div and before the close body tag.
2. Add the relative location of the webviewer.min.js
file using the path
parameter.
3. Add your own license key in place of 'YOUR_LICENSE_KEY'. If you've created your license key and you're logged in, your key is already in the code below.
4. Specify an initial document to open when WebViewer starts using the initialDoc
parameter.
5. Specify the id of the element where you want WebViewer to be mounted. In this case, that's viewer
.
Starting in version 11, WebViewer instantiates using a web component instead of an iframe by default; however, both methods are available. See this guide for more information.
For example, if the WebViewer files are in WebViewer/lib
, your code would look something like this:
After you've saved all of the files, you'll serve the webpage so you can see the WebViewer UI and the PDF you included to open in WebViewer. We'll use http-server to view the webpage in this example.
1. Run the following command on the command line from your project directory to run http-server which is a simple web server.
2. Click the localhost
link created in your terminal to view the WebViewer UI and PDF file locally.
You can also import WebViewer as a CommonJS module when installed manually. It is recommended to install via npm if you have the option.
First, install the module. Replace PATH_TO_WEBVIEWER
with the path from your package.json file to the WebViewer lib folder.
Then use the following import statement in your JavaScript file.
Did you find this helpful?
Trial setup questions?
Ask experts on DiscordNeed other help?
Contact SupportPricing or product questions?
Contact Sales