Merge pull request #3943 from yurydelendik/issue-3942
Fixes cleaning up of the rendered pages
This commit is contained in:
commit
377cb00d9f
@ -67,16 +67,12 @@ var PageView = function pageView(container, id, scale,
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
this.resetRenderingState = function pageViewResetRenderingState() {
|
this.reset = function pageViewReset() {
|
||||||
if (this.renderTask) {
|
if (this.renderTask) {
|
||||||
this.renderTask.cancel();
|
this.renderTask.cancel();
|
||||||
}
|
}
|
||||||
this.resume = null;
|
this.resume = null;
|
||||||
this.renderingState = RenderingStates.INITIAL;
|
this.renderingState = RenderingStates.INITIAL;
|
||||||
};
|
|
||||||
|
|
||||||
this.reset = function pageViewReset() {
|
|
||||||
this.resetRenderingState();
|
|
||||||
|
|
||||||
div.style.width = Math.floor(this.viewport.width) + 'px';
|
div.style.width = Math.floor(this.viewport.width) + 'px';
|
||||||
div.style.height = Math.floor(this.viewport.height) + 'px';
|
div.style.height = Math.floor(this.viewport.height) + 'px';
|
||||||
|
@ -1065,8 +1065,9 @@ var PDFView = {
|
|||||||
|
|
||||||
cleanup: function pdfViewCleanup() {
|
cleanup: function pdfViewCleanup() {
|
||||||
for (var i = 0, ii = this.pages.length; i < ii; i++) {
|
for (var i = 0, ii = this.pages.length; i < ii; i++) {
|
||||||
if (this.pages[i]) {
|
if (this.pages[i] &&
|
||||||
this.pages[i].resetRenderingState();
|
this.pages[i].renderingState !== RenderingStates.FINISHED) {
|
||||||
|
this.pages[i].reset();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.pdfDocument.cleanup();
|
this.pdfDocument.cleanup();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user