Fixes this.xref.trailer.get("ID")[0] is undefined
This commit is contained in:
parent
27d2d99bd8
commit
1fa5e80ebe
14
src/core.js
14
src/core.js
@ -531,13 +531,15 @@ var PDFDocModel = (function PDFDocModelClosure() {
|
|||||||
},
|
},
|
||||||
setup: function pdfDocSetup(ownerPassword, userPassword) {
|
setup: function pdfDocSetup(ownerPassword, userPassword) {
|
||||||
this.checkHeader();
|
this.checkHeader();
|
||||||
this.xref = new XRef(this.stream,
|
var xref = new XRef(this.stream,
|
||||||
this.startXRef,
|
this.startXRef,
|
||||||
this.mainXRefEntriesOffset);
|
this.mainXRefEntriesOffset);
|
||||||
this.catalog = new Catalog(this.xref);
|
this.xref = xref;
|
||||||
if (this.xref.trailer && this.xref.trailer.has('ID')) {
|
this.catalog = new Catalog(xref);
|
||||||
|
if (xref.trailer && xref.trailer.has('ID')) {
|
||||||
var fileID = '';
|
var fileID = '';
|
||||||
this.xref.trailer.get('ID')[0].split('').forEach(function(el) {
|
var id = xref.fetchIfRef(xref.trailer.get('ID'))[0];
|
||||||
|
id.split('').forEach(function(el) {
|
||||||
fileID += Number(el.charCodeAt(0)).toString(16);
|
fileID += Number(el.charCodeAt(0)).toString(16);
|
||||||
});
|
});
|
||||||
this.fileID = fileID;
|
this.fileID = fileID;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user