cdnjs
cdnjs.com โบ home โบ libraries โบ pdf.js โบ 2.6.347
pdf.js - Libraries - cdnjs - The #1 free and open source CDN built to make life easier for developers
Content delivery at its finest. cdnjs is a free and open-source CDN service trusted by over 12.5% of all websites, serving over 200 billion requests each month, powered by Cloudflare.
Mozilla
mozilla.github.io โบ pdf.js
PDF.js - Home
A general-purpose, web standards-based platform for parsing and rendering PDFs.
Videos
jsDelivr
jsdelivr.com โบ package โบ npm โบ pdfjs-dist
pdfjs-dist CDN by jsDelivr - A CDN for npm and GitHub
September 22, 2014 - A free, fast, and reliable CDN for pdfjs-dist. Generic build of Mozilla's PDF.js library.
Published ย Sep 22, 2014
Repository ย https://github.com/mozilla/pdf.js
Top answer 1 of 3
4
You have to set GlobalWorkerOptions.workerSrc to /build/pdf.worker(.min).js of same version:
pdfjsLib.GlobalWorkerOptions.workerSrc =
"https://cdn.jsdelivr.net/npm/[email protected]/build/pdf.worker.min.js";
pdfjsLib.getDocument('./ahmed.pdf').promise.then(doc => {
console.log(`This document has ${doc._pdfInfo.numPages} pages.");
});
And, as @Pasi has mentioned, you have to promisify .getDocument() by chaining .promise on it. Without it, there is no .then().
2 of 3
1
See the "Hello World with document load error handling" example on this page to get started: https://mozilla.github.io/pdf.js/examples/
(Your snippet is missing .promise after getDocument() and setting the workerSrc property)
Mozilla
mozilla.github.io โบ pdf.js โบ getting_started
PDF.js - Getting Started
PDF.js is hosted on several free CDNs: https://www.jsdelivr.com/package/npm/pdfjs-dist ยท https://cdnjs.com/libraries/pdf.js ยท https://unpkg.com/pdfjs-dist/ Note that we only mention the most relevant files and folders.
jsDelivr
cdn.jsdelivr.net โบ build
pdfjs-dist CDN by jsDelivr - A free, fast, and reliable Open Source CDN
Free Open Source CDN for pdfjs-dist ยท Looking for a nice landing page for your package? https://www.jsdelivr.com/package/npm/pdfjs-dist
PDF-LIB
pdf-lib.js.org
PDF-LIB ยท Create and modify PDF documents in any ...
https://cdn.jsdelivr.net/npm/[email protected]/dist/pdf-lib.min.js
jsDelivr
jsdelivr.com โบ package โบ npm โบ pdf.worker
pdf.worker CDN by jsDelivr - A CDN for npm and GitHub
October 10, 2023 - A free, fast, and reliable CDN for pdf.worker. This is a required file for pdf js to work
Published ย Oct 10, 2023
GitHub
github.com โบ mozilla โบ pdf.js โบ discussions โบ 17642
Using CDN links in "demo" `web/viewer.html` ยท mozilla/pdf.js ยท Discussion #17642
Short answer: The library is on CDN's and the demo is not. Long answer: There are two versions of pdf.js.
Author ย mozilla
GitHub
github.com โบ mozilla โบ pdf.js
GitHub - mozilla/pdf.js: PDF Reader in JavaScript
The PDF.js files are large and should be minified for production. To use PDF.js in a web application you can choose to use a pre-built version of the library or to build it from source. We supply pre-built versions for usage with NPM under the pdfjs-dist name.
Starred by 52.4K users
Forked by 10.5K users
Languages ย JavaScript 71.3% | Fluent 25.5% | CSS 2.2%
UNPKG
unpkg.com โบ pdfjs-dist
pdfjs-dist
The CDN for everything on npm
jsDelivr
jsdelivr.com โบ package โบ npm โบ pdfjs-lib
pdfjs-lib CDN by jsDelivr - A CDN for npm and GitHub
January 12, 2023 - A free, fast, and reliable CDN for pdfjs-lib. Generic build of Mozilla's PDF.js library.
Published ย Jan 12, 2023
Repository ย https://github.com/mozilla/pdfjs-dist
CDNPKG
cdnpkg.com โบ home โบ pdf.js โบ 1.9.493
PDF.JS 1.9.493 CDN links [mozilla/pdf.js] - CDNPKG
1 CDN to use with PDF.JS (mozilla/pdf.js) 1.9.493. Find out the best CDN to use with pdf.js 1.9.493 or use multiple CDN as fallback. Simply copy and paste one of these URL !.
PDF.js Express
pdfjs.community โบ technical support
Is there any CDN url for PDFJS express library - Technical Support - PDF.js Express
June 1, 2021 - Hi Team, We are giving the web-viewer folder library path for rendering the pdf. In local it is working. But in our server we are getting path issue. In our angular project we are using only main.js. Do you have CDN url for the library so that we donโt want to store the lib folder in our project and our path issue will be solved.
CDNPKG
cdnpkg.com โบ home โบ pdf.js
PDF.JS CDN links [mozilla/pdf.js] - CDNPKG
1 CDN to use with PDF.JS (mozilla/pdf.js) . Find out the best CDN to use with pdf.js or use multiple CDN as fallback. Simply copy and paste one of these URL !.