mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-26 01:58:06 +02:00
Merge pull request #1022 from notmasteryet/tree-53
Fixes this.xref.trailer.get("ID")[0] is undefined
This commit is contained in:
commit
0817c4274d
3 changed files with 16 additions and 6 deletions
14
src/core.js
14
src/core.js
|
@ -539,13 +539,15 @@ var PDFDocModel = (function PDFDocModelClosure() {
|
|||
},
|
||||
setup: function pdfDocSetup(ownerPassword, userPassword) {
|
||||
this.checkHeader();
|
||||
this.xref = new XRef(this.stream,
|
||||
this.startXRef,
|
||||
this.mainXRefEntriesOffset);
|
||||
this.catalog = new Catalog(this.xref);
|
||||
if (this.xref.trailer && this.xref.trailer.has('ID')) {
|
||||
var xref = new XRef(this.stream,
|
||||
this.startXRef,
|
||||
this.mainXRefEntriesOffset);
|
||||
this.xref = xref;
|
||||
this.catalog = new Catalog(xref);
|
||||
if (xref.trailer && xref.trailer.has('ID')) {
|
||||
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);
|
||||
});
|
||||
this.fileID = fileID;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue