mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-26 10:08:06 +02:00
Cache fonts by reference.
This commit is contained in:
parent
d744be4af7
commit
a8ad07ccbf
5 changed files with 62 additions and 21 deletions
22
src/obj.js
22
src/obj.js
|
@ -187,6 +187,28 @@ var RefSet = (function RefSetClosure() {
|
|||
return RefSet;
|
||||
})();
|
||||
|
||||
var RefSetCache = (function RefSetCacheClosure() {
|
||||
function RefSetCache() {
|
||||
this.dict = {};
|
||||
}
|
||||
|
||||
RefSetCache.prototype = {
|
||||
get: function RefSetCache_get(ref) {
|
||||
return this.dict['R' + ref.num + '.' + ref.gen];
|
||||
},
|
||||
|
||||
has: function RefSetCache_has(ref) {
|
||||
return ('R' + ref.num + '.' + ref.gen) in this.dict;
|
||||
},
|
||||
|
||||
put: function RefSetCache_put(ref, obj) {
|
||||
this.dict['R' + ref.num + '.' + ref.gen] = obj;
|
||||
}
|
||||
};
|
||||
|
||||
return RefSetCache;
|
||||
})();
|
||||
|
||||
var Catalog = (function CatalogClosure() {
|
||||
function Catalog(pdfManager, xref) {
|
||||
this.pdfManager = pdfManager;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue