1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-22 16:18:08 +02:00

Implemented Settings manager. Now remembering scroll positions

This commit is contained in:
Saebekassebil 2011-12-22 22:29:01 +01:00
parent 0e906bbaeb
commit d44f9f2074
3 changed files with 78 additions and 3 deletions

View file

@ -527,6 +527,14 @@ var PDFDocModel = (function PDFDocModelClosure() {
this.startXRef,
this.mainXRefEntriesOffset);
this.catalog = new Catalog(this.xref);
if(this.xref.trailer && this.xref.trailer.has('ID')) {
var fileID = '';
this.xref.trailer.get('ID')[0].split('').forEach(function(el) {
fileID += Number(el.charCodeAt(0)).toString(16);
});
this.fileID = fileID;
}
},
get numPages() {
var linearization = this.linearization;
@ -560,7 +568,7 @@ var PDFDoc = (function PDFDocClosure() {
this.data = data;
this.stream = stream;
this.pdf = new PDFDocModel(stream);
this.fileID = this.pdf.fileID;
this.catalog = this.pdf.catalog;
this.objs = new PDFObjects();

View file

@ -273,7 +273,7 @@ var XRef = (function XRefClosure() {
this.entries = [];
this.xrefstms = {};
var trailerDict = this.readXRef(startXRef);
this.trailer = trailerDict;
// prepare the XRef cache
this.cache = [];