mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-25 09:38:06 +02:00
commit
b46443f0c1
20 changed files with 69 additions and 255 deletions
|
@ -371,7 +371,7 @@ var Catalog = (function CatalogClosure() {
|
|||
var xref = this.xref;
|
||||
var obj = this.catDict.get('Names');
|
||||
|
||||
var javaScript = [];
|
||||
let javaScript = null;
|
||||
function appendIfJavaScriptDict(jsDict) {
|
||||
var type = jsDict.get('S');
|
||||
if (!isName(type, 'JavaScript')) {
|
||||
|
@ -383,6 +383,9 @@ var Catalog = (function CatalogClosure() {
|
|||
} else if (!isString(js)) {
|
||||
return;
|
||||
}
|
||||
if (!javaScript) {
|
||||
javaScript = [];
|
||||
}
|
||||
javaScript.push(stringToPDFString(js));
|
||||
}
|
||||
if (obj && obj.has('JavaScript')) {
|
||||
|
@ -407,6 +410,9 @@ var Catalog = (function CatalogClosure() {
|
|||
// but is supported by many PDF readers/writers (including Adobe's).
|
||||
var action = openactionDict.get('N');
|
||||
if (isName(action, 'Print')) {
|
||||
if (!javaScript) {
|
||||
javaScript = [];
|
||||
}
|
||||
javaScript.push('print({});');
|
||||
}
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue