mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-08 01:10:08 +02:00
Rename the globals to shorter names.
pdfjsDistBuildPdf=pdfjsLib pdfjsDistWebPdfViewer=pdfjsViewer pdfjsDistBuildPdfWorker=pdfjsWorker
This commit is contained in:
parent
6662985a20
commit
01bff1a81d
14 changed files with 66 additions and 68 deletions
|
@ -22,13 +22,13 @@
|
|||
//
|
||||
// The workerSrc property shall be specified.
|
||||
//
|
||||
pdfjsDistBuildPdf.GlobalWorkerOptions.workerSrc =
|
||||
pdfjsLib.GlobalWorkerOptions.workerSrc =
|
||||
'../../node_modules/pdfjs-dist/build/pdf.worker.js';
|
||||
|
||||
//
|
||||
// Asynchronous download PDF
|
||||
//
|
||||
pdfjsDistBuildPdf.getDocument(url).then(function getPdfHelloWorld(pdf) {
|
||||
pdfjsLib.getDocument(url).then(function getPdfHelloWorld(pdf) {
|
||||
//
|
||||
// Fetch the first page
|
||||
//
|
||||
|
|
|
@ -34,12 +34,12 @@
|
|||
//
|
||||
// The workerSrc property shall be specified.
|
||||
//
|
||||
pdfjsDistBuildPdf.GlobalWorkerOptions.workerSrc =
|
||||
pdfjsLib.GlobalWorkerOptions.workerSrc =
|
||||
'../../node_modules/pdfjs-dist/build/pdf.worker.js';
|
||||
|
||||
// Opening PDF by passing its binary data as a string. It is still preferable
|
||||
// to use Uint8Array, but string or array-like structure will work too.
|
||||
pdfjsDistBuildPdf.getDocument({data: pdfData}).then(function getPdfHelloWorld(pdf) {
|
||||
pdfjsLib.getDocument({data: pdfData}).then(function getPdfHelloWorld(pdf) {
|
||||
// Fetch the first page.
|
||||
pdf.getPage(1).then(function getPageHelloWorld(page) {
|
||||
var scale = 1.5;
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
// pdf.js's one, or the pdf.js is executed via eval(), the workerSrc property
|
||||
// shall be specified.
|
||||
//
|
||||
pdfjsDistBuildPdf.GlobalWorkerOptions.workerSrc =
|
||||
pdfjsLib.GlobalWorkerOptions.workerSrc =
|
||||
'../../node_modules/pdfjs-dist/build/pdf.worker.js';
|
||||
|
||||
var pdfDoc = null,
|
||||
|
@ -117,7 +117,7 @@
|
|||
/**
|
||||
* Asynchronously downloads PDF.
|
||||
*/
|
||||
pdfjsDistBuildPdf.getDocument(url).then(function (pdfDoc_) {
|
||||
pdfjsLib.getDocument(url).then(function (pdfDoc_) {
|
||||
pdfDoc = pdfDoc_;
|
||||
document.getElementById('page_count').textContent = pdfDoc.numPages;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue