1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-26 01:58:06 +02:00

Cleaning up fonts when viewer is idle for some time

This commit is contained in:
Yury Delendik 2013-11-14 13:43:38 -08:00
parent 945e370d4f
commit e712c4136a
9 changed files with 93 additions and 9 deletions

View file

@ -25,12 +25,13 @@
var Page = (function PageClosure() {
function Page(pdfManager, xref, pageIndex, pageDict, ref) {
function Page(pdfManager, xref, pageIndex, pageDict, ref, fontCache) {
this.pdfManager = pdfManager;
this.pageIndex = pageIndex;
this.pageDict = pageDict;
this.xref = xref;
this.ref = ref;
this.fontCache = fontCache;
this.idCounters = {
obj: 0
};
@ -160,7 +161,7 @@ var Page = (function PageClosure() {
var partialEvaluator = new PartialEvaluator(
pdfManager, this.xref, handler,
this.pageIndex, 'p' + this.pageIndex + '_',
this.idCounters);
this.idCounters, this.fontCache);
var dataPromises = Promise.all(
[contentStreamPromise, resourcesPromise], reject);
@ -226,7 +227,7 @@ var Page = (function PageClosure() {
var partialEvaluator = new PartialEvaluator(
pdfManager, self.xref, handler,
self.pageIndex, 'p' + self.pageIndex + '_',
self.idCounters);
self.idCounters, self.fontCache);
var bidiTexts = partialEvaluator.getTextContent(contentStream,
self.resources);
@ -496,6 +497,10 @@ var PDFDocument = (function PDFDocumentClosure() {
getPage: function PDFDocument_getPage(pageIndex) {
return this.catalog.getPage(pageIndex);
},
cleanup: function PDFDocument_cleanup() {
return this.catalog.cleanup();
}
};