From 81d3f4a89b51629cffafe083de47e2ce7e8fbd85 Mon Sep 17 00:00:00 2001 From: koderok Date: Sat, 24 May 2014 05:37:25 +0530 Subject: [PATCH] merged with earlier commits --- src/core/obj.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/core/obj.js b/src/core/obj.js index 5b1415c42..0b6d2d764 100644 --- a/src/core/obj.js +++ b/src/core/obj.js @@ -503,6 +503,22 @@ var Catalog = (function CatalogClosure() { javaScript.push(stringToPDFString(js)); } } + + // Append OpenAction actions to javaScript array + var openactionDict = this.catDict.get('OpenAction'); + if (isDict(openactionDict)) { + var objType = openactionDict.get('Type'); + var actionType = openactionDict.get('S'); + var action = openactionDict.get('N'); + var isPrintAction = (isName(objType) && objType.name === 'Action' && + isName(actionType) && actionType.name === 'Named' && + isName(action) && action.name === 'Print'); + + if (isPrintAction) { + javaScript.push('print(true);'); + } + } + return shadow(this, 'javaScript', javaScript); },