Merge pull request #3920 from brendandahl/text-promise

Use page promise for text extraction.
This commit is contained in:
Yury Delendik 2013-11-14 11:07:26 -08:00
commit 945e370d4f

View File

@ -33,7 +33,6 @@ var PageView = function pageView(container, id, scale,
this.renderingState = RenderingStates.INITIAL; this.renderingState = RenderingStates.INITIAL;
this.resume = null; this.resume = null;
this.textContent = null;
this.textLayer = null; this.textLayer = null;
this.zoomLayer = null; this.zoomLayer = null;
@ -406,10 +405,9 @@ var PageView = function pageView(container, id, scale,
}; };
this.getTextContent = function pageviewGetTextContent() { this.getTextContent = function pageviewGetTextContent() {
if (!this.textContent) { return PDFView.getPage(this.id).then(function(pdfPage) {
this.textContent = this.pdfPage.getTextContent(); return pdfPage.getTextContent();
} });
return this.textContent;
}; };
this.draw = function pageviewDraw(callback) { this.draw = function pageviewDraw(callback) {