From 6b9aeb34f1a2ad99372d5ee18cee397a60d86c6c Mon Sep 17 00:00:00 2001 From: Tim van der Meij Date: Fri, 2 May 2014 20:45:34 +0200 Subject: [PATCH] Fixes rendering of PDFs with nested trailer dictionary --- src/core/obj.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/core/obj.js b/src/core/obj.js index ce25d1168..8d6145235 100644 --- a/src/core/obj.js +++ b/src/core/obj.js @@ -731,6 +731,11 @@ var XRef = (function XRefClosure() { // The parser goes through the entire stream << ... >> and provides // a getter interface for the key-value table var dict = parser.getObj(); + + // The pdflib PDF generator can generate a nested trailer dictionary + if (!isDict(dict) && dict.dict) { + dict = dict.dict; + } if (!isDict(dict)) { error('Invalid XRef table: could not parse trailer dictionary'); }