diff --git a/web/page_view.js b/web/page_view.js index 3bf6eb9a7..6b88a8f15 100644 --- a/web/page_view.js +++ b/web/page_view.js @@ -33,7 +33,6 @@ var PageView = function pageView(container, id, scale, this.renderingState = RenderingStates.INITIAL; this.resume = null; - this.textContent = null; this.textLayer = null; this.zoomLayer = null; @@ -406,10 +405,9 @@ var PageView = function pageView(container, id, scale, }; this.getTextContent = function pageviewGetTextContent() { - if (!this.textContent) { - this.textContent = this.pdfPage.getTextContent(); - } - return this.textContent; + return PDFView.getPage(this.id).then(function(pdfPage) { + return pdfPage.getTextContent(); + }); }; this.draw = function pageviewDraw(callback) {