|
|
|
@ -587,7 +587,8 @@ var PDFDocModel = (function PDFDocModelClosure() {
@@ -587,7 +587,8 @@ var PDFDocModel = (function PDFDocModelClosure() {
|
|
|
|
|
this.mainXRefEntriesOffset); |
|
|
|
|
this.xref = xref; |
|
|
|
|
this.catalog = new Catalog(xref); |
|
|
|
|
if (xref.trailer && xref.trailer.has('ID')) { |
|
|
|
|
if (xref.trailer) { |
|
|
|
|
if (xref.trailer.has('ID')) { |
|
|
|
|
var fileID = ''; |
|
|
|
|
var id = xref.fetchIfRef(xref.trailer.get('ID'))[0]; |
|
|
|
|
id.split('').forEach(function(el) { |
|
|
|
@ -595,6 +596,7 @@ var PDFDocModel = (function PDFDocModelClosure() {
@@ -595,6 +596,7 @@ var PDFDocModel = (function PDFDocModelClosure() {
|
|
|
|
|
}); |
|
|
|
|
this.fileID = fileID; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
get numPages() { |
|
|
|
|
var linearization = this.linearization; |
|
|
|
@ -602,6 +604,11 @@ var PDFDocModel = (function PDFDocModelClosure() {
@@ -602,6 +604,11 @@ var PDFDocModel = (function PDFDocModelClosure() {
|
|
|
|
|
// shadow the prototype getter
|
|
|
|
|
return shadow(this, 'numPages', num); |
|
|
|
|
}, |
|
|
|
|
getDocumentInfo: function pdfDocGetDocumentInfo() { |
|
|
|
|
if (this.xref.trailer.has('Info')) { |
|
|
|
|
return this.xref.fetch(this.xref.trailer.get('Info')); |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
getFingerprint: function pdfDocGetFingerprint() { |
|
|
|
|
if (this.fileID) { |
|
|
|
|
return this.fileID; |
|
|
|
@ -645,6 +652,7 @@ var PDFDoc = (function PDFDocClosure() {
@@ -645,6 +652,7 @@ var PDFDoc = (function PDFDocClosure() {
|
|
|
|
|
this.stream = stream; |
|
|
|
|
this.pdfModel = new PDFDocModel(stream); |
|
|
|
|
this.fingerprint = this.pdfModel.getFingerprint(); |
|
|
|
|
this.info = this.pdfModel.getDocumentInfo(); |
|
|
|
|
this.catalog = this.pdfModel.catalog; |
|
|
|
|
this.objs = new PDFObjects(); |
|
|
|
|
|
|
|
|
|