iCHEF / pdf.js-public

PDF Reader in JavaScript

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

PDF.js

This is the forked version of PDF.js. NOT the official repo.

If you are looking for the official repo of PDF.js, please visit mozilla/pdf.js.

Usage

We publish the distribution files (the viewer) as private npm packages.

Development

Install Dependencies

Using npm install with NPM v7 above will upgrade the lockfileVersion of package-lock.json and result in a huge package-lock.json file.

You can use npm ci instead to install the dependencies: https://docs.npmjs.com/cli/v7/commands/npm-ci

Build viewer

There are several scripts to build the viewer with different setting:

npm run build:generic # For modern browser (Not include iOS Safari)
npm run build:generic-legacy # Support more browsers
npm run build:minified # For modern browser (Not include iOS Safari) and with JS minified
npm run build:minified-legacy # Support more browsers with JS minified

npm run build will run npm run build:minified-legacy by default.

Example Output:

build/
└── minified-legacy/
    ├── build/
    │   ├── pdf.js                             - display layer
    │   ├── pdf.js.map                         - display layer's source map
    │   ├── pdf.sandbox.js                     - secure container for embedded script
    │   ├── pdf.sandbox.js.map                 - secure container's source map
    │   ├── pdf.worker.js                      - core layer
    │   └── pdf.worker.js.map                  - core layer's source map
    ├── web/
    │   ├── cmaps/                             - character maps (required by core)
    │   ├── images/                            - images for the viewer and annotation icons
    │   ├── locale/                            - translation files
    │   ├── standard_fonts/                    - basic fonts used for render pdf file without embedded font
    │   ├── debugger.js                        - helpful debugging features
    │   ├── viewer.css                         - viewer style sheet
    │   ├── viewer.html                        - viewer layout
    │   ├── viewer.js                          - viewer layer
    │   └── viewer.js.map                      - viewer layer's source map
    └── LICENSE

About

PDF Reader in JavaScript

License:Apache License 2.0


Languages

Language:JavaScript 97.5%Language:CSS 1.5%Language:HTML 1.0%Language:TypeScript 0.0%Language:Shell 0.0%