|
|
@ -790,6 +790,10 @@ var PageView = function pageView(container, content, id, pageWidth, pageHeight, |
|
|
|
div.appendChild(canvas); |
|
|
|
div.appendChild(canvas); |
|
|
|
this.canvas = canvas; |
|
|
|
this.canvas = canvas; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var loadingIconDiv = document.createElement('div'); |
|
|
|
|
|
|
|
loadingIconDiv.className = 'loadingIcon'; |
|
|
|
|
|
|
|
div.appendChild(loadingIconDiv); |
|
|
|
|
|
|
|
|
|
|
|
var textLayerDiv = null; |
|
|
|
var textLayerDiv = null; |
|
|
|
if (!PDFJS.disableTextLayer) { |
|
|
|
if (!PDFJS.disableTextLayer) { |
|
|
|
textLayerDiv = document.createElement('div'); |
|
|
|
textLayerDiv = document.createElement('div'); |
|
|
@ -809,19 +813,30 @@ 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; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Display loading icon if page hasn't finished rendering after XXXX ms
|
|
|
|
|
|
|
|
var loadingTimer = setTimeout(function loadingTimerCallback() { |
|
|
|
|
|
|
|
loadingIconDiv.classList.add('show'); |
|
|
|
|
|
|
|
}, 1000); |
|
|
|
|
|
|
|
|
|
|
|
stats.begin = Date.now(); |
|
|
|
stats.begin = Date.now(); |
|
|
|
this.content.startRendering(ctx, |
|
|
|
this.content.startRendering(ctx, function pageViewDrawCallback(error) { |
|
|
|
(function pageViewDrawCallback(error) { |
|
|
|
clearTimeout(loadingTimer); |
|
|
|
|
|
|
|
loadingIconDiv.classList.remove('show'); |
|
|
|
|
|
|
|
|
|
|
|
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); |
|
|
|