WebViewer is a powerful JavaScript-based PDF Library that is part of the Apryse SDK. It provides a slick out-of-the-box responsive UI that enables you to view, annotate and manipulate PDFs and other document types inside any web project.
This sample shows how you can load WebViewer offline using service worker and localforage.
A license key is required to run WebViewer. You can obtain a trial key in our get started guides, or by signing-up on our developer portal.
Before you begin, make sure your development environment includes Node.js.
git clone --depth=1 https://github.com/ApryseSDK/webviewer-samples.git
cd webviewer-samples/webviewer-offline
npm install
In the root folder, run the following
node prepare-serviceworker-list.js
This will generate a json file service-worker-list.json that contains the list of files to be cached in service worker.
npm start