Browse Source

Merge pull request #2650 from yurydelendik/form-bar

Fallback when AcroForm is present
Mack Duan 12 years ago
parent
commit
1a1c5abca6
  1. 3
      src/core.js
  2. 9
      web/viewer.js

3
src/core.js

@ -535,7 +535,8 @@ var PDFDocument = (function PDFDocumentClosure() {
}, },
getDocumentInfo: function PDFDocument_getDocumentInfo() { getDocumentInfo: function PDFDocument_getDocumentInfo() {
var docInfo = { var docInfo = {
PDFFormatVersion: this.pdfFormatVersion PDFFormatVersion: this.pdfFormatVersion,
IsAcroFormPresent: !!this.acroForm
}; };
if (this.xref.trailer.has('Info')) { if (this.xref.trailer.has('Info')) {
var infoDict = this.xref.trailer.get('Info'); var infoDict = this.xref.trailer.get('Info');

9
web/viewer.js

@ -1345,6 +1345,11 @@ var PDFView = {
if (pdfTitle) if (pdfTitle)
self.setTitle(pdfTitle + ' - ' + document.title); 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) if (textAnnotation)
div.appendChild(textAnnotation); div.appendChild(textAnnotation);
break; break;
case 'Widget':
// TODO: support forms
PDFView.fallback();
break;
} }
} }
}); });

Loading…
Cancel
Save