WebViewer is a powerful JavaScript-based PDF Library that's part of the PDFTron PDF SDK. This repo is specifically designed for any users interested in making their own UI.
This sample codebase demonstrates
- How to leverage PDFTron's document renderer without an
<iFrame>
- How to define custom
<button>
elements and implement functionality from the PDFTron SDK such as- Zoom In/Out
- Drawing Rectangles
- Select Tool
- Creating and Applying Redactions
- How to implement searching using DocViewer Search APIs
Before you begin, make sure your development environment includes Node.js.
git clone https://github.com/PDFTron/webviewer-custom-ui.git
cd webviewer-custom-ui
npm install
npm start
Run npm run build
to build the project. The build artifacts will be stored in the build/
directory. See the section about deployment for more information.
To test the build directory locally you can use serve or http-server. In case of serve, by default it strips the .html extension stripped from paths. We added serve.json configuration to disable cleanUrls option.
See API documentation.
See contributing.
See license.