skip cached objects and has consistent font ids
This commit is contained in:
parent
b6edbb38c1
commit
cff6c8db08
@ -489,6 +489,8 @@ var WorkerTransport = (function WorkerTransportClosure() {
|
||||
messageHandler.on('obj', function transportObj(data) {
|
||||
var id = data[0];
|
||||
var type = data[1];
|
||||
if (this.objs.hasData(id))
|
||||
return;
|
||||
|
||||
switch (type) {
|
||||
case 'JpegStream':
|
||||
|
@ -153,13 +153,14 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
|
||||
|
||||
font = xref.fetchIfRef(font) || fontRes.get(fontName);
|
||||
assertWellFormed(isDict(font));
|
||||
++self.objIdCounter;
|
||||
if (!font.translated) {
|
||||
font.translated = self.translateFont(font, xref, resources,
|
||||
dependency);
|
||||
if (font.translated) {
|
||||
// keep track of each font we translated so the caller can
|
||||
// load them asynchronously before calling display on a page
|
||||
loadedName = 'font_' + uniquePrefix + (++self.objIdCounter);
|
||||
loadedName = 'font_' + uniquePrefix + self.objIdCounter;
|
||||
font.translated.properties.loadedName = loadedName;
|
||||
font.loadedName = loadedName;
|
||||
|
||||
|
@ -194,13 +194,15 @@ function nextPage(task, loadError) {
|
||||
textLayer: textLayerBuilder,
|
||||
viewport: viewport
|
||||
};
|
||||
page.render(renderContext).then(function() {
|
||||
var completeRender = (function(error) {
|
||||
page.destroy();
|
||||
snapshotCurrentPage(task, false);
|
||||
snapshotCurrentPage(task, error);
|
||||
});
|
||||
page.render(renderContext).then(function() {
|
||||
completeRender(false);
|
||||
},
|
||||
function(error) {
|
||||
page.destroy();
|
||||
snapshotCurrentPage(task, 'render : ' + error);
|
||||
completeRender('render : ' + error);
|
||||
});
|
||||
},
|
||||
function(error) {
|
||||
|
Loading…
Reference in New Issue
Block a user