|
|
@ -644,6 +644,10 @@ var PageView = function pageView(container, content, id, pageWidth, pageHeight, |
|
|
|
div.removeAttribute('data-loaded'); |
|
|
|
div.removeAttribute('data-loaded'); |
|
|
|
|
|
|
|
|
|
|
|
delete this.canvas; |
|
|
|
delete this.canvas; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.loadingIconDiv = document.createElement('div'); |
|
|
|
|
|
|
|
this.loadingIconDiv.className = 'loadingIcon'; |
|
|
|
|
|
|
|
div.appendChild(this.loadingIconDiv); |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
function setupAnnotations(content, scale) { |
|
|
|
function setupAnnotations(content, scale) { |
|
|
@ -808,7 +812,7 @@ var PageView = function pageView(container, content, id, pageWidth, pageHeight, |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
this.drawingRequired = function() { |
|
|
|
this.drawingRequired = function() { |
|
|
|
return !div.hasChildNodes(); |
|
|
|
return !div.querySelector('canvas'); |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
this.draw = function pageviewDraw(callback) { |
|
|
|
this.draw = function pageviewDraw(callback) { |
|
|
@ -843,19 +847,23 @@ var PageView = function pageView(container, content, id, pageWidth, pageHeight, |
|
|
|
ctx.restore(); |
|
|
|
ctx.restore(); |
|
|
|
ctx.translate(-this.x * scale, -this.y * scale); |
|
|
|
ctx.translate(-this.x * scale, -this.y * scale); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Rendering area
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var self = this; |
|
|
|
stats.begin = Date.now(); |
|
|
|
stats.begin = Date.now(); |
|
|
|
this.content.startRendering(ctx, |
|
|
|
this.content.startRendering(ctx, function pageViewDrawCallback(error) { |
|
|
|
(function pageViewDrawCallback(error) { |
|
|
|
div.removeChild(self.loadingIconDiv); |
|
|
|
|
|
|
|
|
|
|
|
if (error) |
|
|
|
if (error) |
|
|
|
PDFView.error('An error occurred while rendering the page.', error); |
|
|
|
PDFView.error('An error occurred while rendering the page.', error); |
|
|
|
this.updateStats(); |
|
|
|
|
|
|
|
if (this.onAfterDraw) |
|
|
|
|
|
|
|
this.onAfterDraw(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
cache.push(this); |
|
|
|
self.updateStats(); |
|
|
|
|
|
|
|
if (self.onAfterDraw) |
|
|
|
|
|
|
|
self.onAfterDraw(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
cache.push(self); |
|
|
|
callback(); |
|
|
|
callback(); |
|
|
|
}).bind(this), textLayer |
|
|
|
}, textLayer); |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
setupAnnotations(this.content, this.scale); |
|
|
|
setupAnnotations(this.content, this.scale); |
|
|
|
div.setAttribute('data-loaded', true); |
|
|
|
div.setAttribute('data-loaded', true); |
|
|
|