PDF.js Express Plusplay_arrow

Professional PDF.js Viewing & Annotations - Try for free

side menu

Get Started

play_arrow

Learn more

play_arrow

Common use cases

play_arrow

Open a document

play_arrow

Save a document

play_arrow

Viewer

play_arrow

UI Customization

play_arrow

Annotations

play_arrow

Collaboration

play_arrow

Forms

play_arrow

Signature

play_arrow

Searching

play_arrow

Measurement

play_arrow

Compare

play_arrow

Advanced Capabilities

play_arrow

PDF.js Express REST API

play_arrow

Migration Guides

play_arrow

Advanced customization

The following features are available in:

check

PDF.js Express Viewer

help_outline

PDF.js Express Viewer is a free viewer with limited capabilities compared to PDF.js Express Plus

check

PDF.js Express Plus

help_outline

PDF.js Express Plus is a commercial PDF SDK for viewing, annotating, signing, form filling and more

The PDF.js Express Web Viewer UI provides a great developer experience for anyone interested in the source code. You can make adjustments of your own, run it to test, and build it to deploy.

Folder structure

src/
  apis/            - APIs exposed in myWebViewer.getInstance()
  components/      - React components
  constants/       - JavaScript or CSS constants
  core/            - APIs from the Core
  event-listeners/ - Listeners for the Core events
  helpers/         - Reused functions
  redux/           - Redux files for state managing

Forking and linking

A fork is a copy of a repository. Forking a repository allows you to freely experiment with changes without affecting the original project. To fork and sync with PDFTron's webviewer-ui repo, follow these steps:

  1. Go to https://github.com/PDFTron/webviewer-ui.
  2. In the top-right corner of the page, click Fork.
  3. Open terminal and navigate to your destination folder.
  4. Run the following:
git clone https://github.com/YOUR-USERNAME/webviewer-ui
cd webviewer-ui
git remote add upstream https://github.com/PDFTron/webviewer-ui

See Forking a repo for more information.

Switching branches

The default branch of the repo is the latest stable WebViewer version. For example, if the default branch is 7.1, then it means the latest official WebViewer version is 7.1.

You should switch the branch to be the WebViewer version you are currently using for your application. For example, if you are using WebViewer 7.0 then you should switch to the 7.0 branch and modify the code there. If you are using the legacy UI, then you need to switch to legacy/7.0 instead.

Code in the master branch is considered to be experimental and is not safe to be used in production. Generally we don't recommend that you modify the code in the master branch.

Run

To run the project,

  1. Go to lib/ui/
  2. Run npm install
  3. Run npm start

Build

To build the source files into webviewer-ui.min.js,

  1. Run npm run build

Work with the public repo in Github

For a better developer experience, we have open sourced the project in Github. It allows you to keep track of your changes better or sync with future versions easier.

Sync the fork

When you want to merge any changes from the original PDFTron's webviewer-ui repo, follow these steps:

  1. Open terminal and navigate to WebViewer/lib/ui
  2. Run the following:
git fetch upstream master
git checkout master
git merge upstream/master

See Syncing a fork for more information.

Make pull requests

If you want your changes to be implemented into PDFTron's webviewer-ui so that they are available in future releases, see Creating a pull request.