mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-10 02:05:37 +02:00
Merge remote-tracking branch 'mozilla/version-2.0' into v2
This commit is contained in:
commit
b4e25fb2e8
18 changed files with 66 additions and 252 deletions
18
web/app.js
18
web/app.js
|
@ -55,13 +55,11 @@ function configure(PDFJS) {
|
|||
}
|
||||
if (typeof PDFJSDev === 'undefined' || !PDFJSDev.test('PRODUCTION')) {
|
||||
PDFJS.cMapUrl = '../external/bcmaps/';
|
||||
PDFJS.cMapPacked = true;
|
||||
PDFJS.workerSrc = '../src/worker_loader.js';
|
||||
PDFJS.pdfjsNext = true;
|
||||
} else {
|
||||
PDFJS.cMapUrl = '../web/cmaps/';
|
||||
PDFJS.cMapPacked = true;
|
||||
}
|
||||
PDFJS.cMapPacked = true;
|
||||
}
|
||||
|
||||
const DefaultExternalServices = {
|
||||
|
@ -633,11 +631,6 @@ let PDFViewerApplication = {
|
|||
* is opened.
|
||||
*/
|
||||
open(file, args) {
|
||||
if ((typeof PDFJSDev === 'undefined' || PDFJSDev.test('GENERIC')) &&
|
||||
(arguments.length > 2 || typeof args === 'number')) {
|
||||
return Promise.reject(
|
||||
new Error('Call of open() with obsolete signature.'));
|
||||
}
|
||||
if (this.pdfLoadingTask) {
|
||||
// We need to destroy already opened document.
|
||||
return this.close().then(() => {
|
||||
|
@ -667,12 +660,7 @@ let PDFViewerApplication = {
|
|||
|
||||
if (args) {
|
||||
for (let prop in args) {
|
||||
if ((typeof PDFJSDev === 'undefined' || !PDFJSDev.test('PDFJS_NEXT')) &&
|
||||
!PDFJS.pdfjsNext && prop === 'scale') {
|
||||
console.error('Call of open() with obsolete "scale" argument, ' +
|
||||
'please use the "defaultZoomValue" preference instead.');
|
||||
continue;
|
||||
} else if (prop === 'length') {
|
||||
if (prop === 'length') {
|
||||
this.pdfDocumentProperties.setFileSize(args[prop]);
|
||||
}
|
||||
parameters[prop] = args[prop];
|
||||
|
@ -1047,7 +1035,7 @@ let PDFViewerApplication = {
|
|||
return;
|
||||
}
|
||||
pdfDocument.getJavaScript().then((javaScript) => {
|
||||
if (javaScript.length === 0) {
|
||||
if (!javaScript) {
|
||||
return;
|
||||
}
|
||||
javaScript.some((js) => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue