3.6.172-alpha.1 • Published 2 years ago
@bundled-es-modules/pdfjs-dist v3.6.172-alpha.1
pdfjs-dist
This is a mirror of pdfjs-dist, bundled and exposed as an ES module
Install
npm install @bundled-es-modules/pdfjs-dist
Use
import pdfjs from "@bundled-es-modules/pdfjs-dist/build/pdf";
import viewer from "@bundled-es-modules/pdfjs-dist/web/pdf_viewer";
pdfjs.GlobalWorkerOptions.workerSrc =
"@bundled-es-modules/pdfjs-dist/build/pdf.worker.js";
var url = "basicapi.pdf";
var loadingTask = pdfjs.getDocument(url);
//...
Important: Unlike in the original build, the pdfjs.GlobalWorkerOptions.workerSrc
is mandatory. We recommend supplying the worker via CDN.
Overview
Structure
├── build/
│ ├── pdf.js - display layer
│ └── pdf.worker.js - core layer
|── types/ - typescript typings
└── web/
├── pdf_viewer.js - top-level viewer import, containing all necessary setup
├── module.js - pdf-viewer module, transformed from UMD to ESM
└── util.js - utility module for setup
Background
PDFJS is a library by Mozilla, created to facillitate client-side rendering of PDF documents.
Currently, the primary build for this project is provided as UMD-style modules at pdfjs/pdfjs-dist.
Support for es modules in the main project has been requested here (#10317)
Building
npm i
npm run build
3.6.172-alpha.1
2 years ago
2.16.106
2 years ago
2.16.105
2 years ago
2.16.105-alpha.1
2 years ago
2.16.105-alpha.2
2 years ago
2.5.207-rc1
4 years ago
2.2.228-alpha1
5 years ago
2.1.228-alpha1
5 years ago
2.1.266
5 years ago
2.1.266-rc
6 years ago
2.0.943-viewer
6 years ago
2.0.943-repofix
6 years ago
2.0.943
6 years ago