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) {
|
messageHandler.on('obj', function transportObj(data) {
|
||||||
var id = data[0];
|
var id = data[0];
|
||||||
var type = data[1];
|
var type = data[1];
|
||||||
|
if (this.objs.hasData(id))
|
||||||
|
return;
|
||||||
|
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case 'JpegStream':
|
case 'JpegStream':
|
||||||
|
@ -153,13 +153,14 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
|
|||||||
|
|
||||||
font = xref.fetchIfRef(font) || fontRes.get(fontName);
|
font = xref.fetchIfRef(font) || fontRes.get(fontName);
|
||||||
assertWellFormed(isDict(font));
|
assertWellFormed(isDict(font));
|
||||||
|
++self.objIdCounter;
|
||||||
if (!font.translated) {
|
if (!font.translated) {
|
||||||
font.translated = self.translateFont(font, xref, resources,
|
font.translated = self.translateFont(font, xref, resources,
|
||||||
dependency);
|
dependency);
|
||||||
if (font.translated) {
|
if (font.translated) {
|
||||||
// keep track of each font we translated so the caller can
|
// keep track of each font we translated so the caller can
|
||||||
// load them asynchronously before calling display on a page
|
// 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.translated.properties.loadedName = loadedName;
|
||||||
font.loadedName = loadedName;
|
font.loadedName = loadedName;
|
||||||
|
|
||||||
|
@ -194,13 +194,15 @@ function nextPage(task, loadError) {
|
|||||||
textLayer: textLayerBuilder,
|
textLayer: textLayerBuilder,
|
||||||
viewport: viewport
|
viewport: viewport
|
||||||
};
|
};
|
||||||
page.render(renderContext).then(function() {
|
var completeRender = (function(error) {
|
||||||
page.destroy();
|
page.destroy();
|
||||||
snapshotCurrentPage(task, false);
|
snapshotCurrentPage(task, error);
|
||||||
|
});
|
||||||
|
page.render(renderContext).then(function() {
|
||||||
|
completeRender(false);
|
||||||
},
|
},
|
||||||
function(error) {
|
function(error) {
|
||||||
page.destroy();
|
completeRender('render : ' + error);
|
||||||
snapshotCurrentPage(task, 'render : ' + error);
|
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
function(error) {
|
function(error) {
|
||||||
|
Loading…
Reference in New Issue
Block a user