Merge pull request #2426 from yurydelendik/fix-2346

Fixes "TypeError: info is undefined"
This commit is contained in:
Brendan Dahl 2012-11-30 16:06:24 -08:00
commit f3ff673240

View File

@ -526,13 +526,12 @@ var PDFDocument = (function PDFDocumentClosure() {
return shadow(this, 'numPages', num);
},
getDocumentInfo: function PDFDocument_getDocumentInfo() {
var docInfo;
var docInfo = {
PDFFormatVersion: this.pdfFormatVersion
};
if (this.xref.trailer.has('Info')) {
var infoDict = this.xref.trailer.get('Info');
docInfo = {
PDFFormatVersion: this.pdfFormatVersion
};
var validEntries = DocumentInfoValidators.entries;
// Only fill the document info with valid entries from the spec.
for (var key in validEntries) {