WebViewer is a powerful JavaScript-based PDF Library that's part of the PDFTron PDF SDK. It provides a slick out-of-the-box responsive UI that interacts with the core library to view, annotate and manipulate PDFs that can be embedded into any web project.
This repo shows how you can load WebViewer offline using service worker and localforage.
Before you begin, make sure your development environment includes Node.js.
git clone https://github.com/PDFTron/webviewer-offline-sample.git
cd webviewer-offline-sample
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