|
|
@ -1102,12 +1102,24 @@ var PDFPageView = function PDFPageViewClosure() { |
|
|
|
this.reset(); |
|
|
|
this.reset(); |
|
|
|
}, |
|
|
|
}, |
|
|
|
destroy: function PDFPageView_destroy() { |
|
|
|
destroy: function PDFPageView_destroy() { |
|
|
|
this.zoomLayer = null; |
|
|
|
|
|
|
|
this.reset(); |
|
|
|
this.reset(); |
|
|
|
if (this.pdfPage) { |
|
|
|
if (this.pdfPage) { |
|
|
|
this.pdfPage.cleanup(); |
|
|
|
this.pdfPage.cleanup(); |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
_resetZoomLayer: function (removeFromDOM) { |
|
|
|
|
|
|
|
if (!this.zoomLayer) { |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
var zoomLayerCanvas = this.zoomLayer.firstChild; |
|
|
|
|
|
|
|
this.paintedViewportMap.delete(zoomLayerCanvas); |
|
|
|
|
|
|
|
zoomLayerCanvas.width = 0; |
|
|
|
|
|
|
|
zoomLayerCanvas.height = 0; |
|
|
|
|
|
|
|
if (removeFromDOM) { |
|
|
|
|
|
|
|
this.zoomLayer.remove(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
this.zoomLayer = null; |
|
|
|
|
|
|
|
}, |
|
|
|
reset: function PDFPageView_reset(keepZoomLayer, keepAnnotations) { |
|
|
|
reset: function PDFPageView_reset(keepZoomLayer, keepAnnotations) { |
|
|
|
this.cancelRendering(); |
|
|
|
this.cancelRendering(); |
|
|
|
var div = this.div; |
|
|
|
var div = this.div; |
|
|
@ -1129,12 +1141,15 @@ var PDFPageView = function PDFPageViewClosure() { |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
this.annotationLayer = null; |
|
|
|
this.annotationLayer = null; |
|
|
|
} |
|
|
|
} |
|
|
|
if (this.canvas && !currentZoomLayerNode) { |
|
|
|
if (!currentZoomLayerNode) { |
|
|
|
|
|
|
|
if (this.canvas) { |
|
|
|
this.paintedViewportMap.delete(this.canvas); |
|
|
|
this.paintedViewportMap.delete(this.canvas); |
|
|
|
this.canvas.width = 0; |
|
|
|
this.canvas.width = 0; |
|
|
|
this.canvas.height = 0; |
|
|
|
this.canvas.height = 0; |
|
|
|
delete this.canvas; |
|
|
|
delete this.canvas; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
this._resetZoomLayer(); |
|
|
|
|
|
|
|
} |
|
|
|
if (this.svg) { |
|
|
|
if (this.svg) { |
|
|
|
this.paintedViewportMap.delete(this.svg); |
|
|
|
this.paintedViewportMap.delete(this.svg); |
|
|
|
delete this.svg; |
|
|
|
delete this.svg; |
|
|
@ -1329,16 +1344,7 @@ var PDFPageView = function PDFPageViewClosure() { |
|
|
|
div.removeChild(self.loadingIconDiv); |
|
|
|
div.removeChild(self.loadingIconDiv); |
|
|
|
delete self.loadingIconDiv; |
|
|
|
delete self.loadingIconDiv; |
|
|
|
} |
|
|
|
} |
|
|
|
if (self.zoomLayer) { |
|
|
|
self._resetZoomLayer(true); |
|
|
|
var zoomLayerCanvas = self.zoomLayer.firstChild; |
|
|
|
|
|
|
|
self.paintedViewportMap.delete(zoomLayerCanvas); |
|
|
|
|
|
|
|
zoomLayerCanvas.width = 0; |
|
|
|
|
|
|
|
zoomLayerCanvas.height = 0; |
|
|
|
|
|
|
|
if (div.contains(self.zoomLayer)) { |
|
|
|
|
|
|
|
div.removeChild(self.zoomLayer); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
self.zoomLayer = null; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
self.error = error; |
|
|
|
self.error = error; |
|
|
|
self.stats = pdfPage.stats; |
|
|
|
self.stats = pdfPage.stats; |
|
|
|
if (self.onAfterDraw) { |
|
|
|
if (self.onAfterDraw) { |
|
|
|