From 9c044e2c31474cb9df491a3636687a87ed8c56a3 Mon Sep 17 00:00:00 2001 From: Yury Delendik Date: Thu, 31 Jan 2013 16:46:44 -0500 Subject: [PATCH] Fallback when AcroForm is present --- src/core.js | 3 ++- web/viewer.js | 9 +++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/core.js b/src/core.js index 2e6991caa..822175f5d 100644 --- a/src/core.js +++ b/src/core.js @@ -535,7 +535,8 @@ var PDFDocument = (function PDFDocumentClosure() { }, getDocumentInfo: function PDFDocument_getDocumentInfo() { var docInfo = { - PDFFormatVersion: this.pdfFormatVersion + PDFFormatVersion: this.pdfFormatVersion, + IsAcroFormPresent: !!this.acroForm }; if (this.xref.trailer.has('Info')) { var infoDict = this.xref.trailer.get('Info'); diff --git a/web/viewer.js b/web/viewer.js index 6fd11e927..a2b41da4f 100644 --- a/web/viewer.js +++ b/web/viewer.js @@ -1345,6 +1345,11 @@ var PDFView = { if (pdfTitle) self.setTitle(pdfTitle + ' - ' + document.title); + + if (info.IsAcroFormPresent) { + // AcroForm/XFA was found + PDFView.fallback(); + } }); }, @@ -1955,10 +1960,6 @@ var PageView = function pageView(container, pdfPage, id, scale, if (textAnnotation) div.appendChild(textAnnotation); break; - case 'Widget': - // TODO: support forms - PDFView.fallback(); - break; } } });