Browse Source

Merge pull request #3920 from brendandahl/text-promise

Use page promise for text extraction.
Yury Delendik 12 years ago
parent
commit
945e370d4f
  1. 8
      web/page_view.js

8
web/page_view.js

@ -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) {

Loading…
Cancel
Save