mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-20 15:18:08 +02:00
Refactors getTextContent return value
This commit is contained in:
parent
11e0ab3530
commit
96fff4cc74
4 changed files with 22 additions and 28 deletions
|
@ -150,9 +150,7 @@ var PDFFindController = {
|
|||
var self = this;
|
||||
function extractPageText(pageIndex) {
|
||||
self.pdfPageSource.pages[pageIndex].getTextContent().then(
|
||||
function textContentResolved(data) {
|
||||
// Build the find string.
|
||||
var bidiTexts = data.bidiTexts;
|
||||
function textContentResolved(bidiTexts) {
|
||||
var str = '';
|
||||
|
||||
for (var i = 0; i < bidiTexts.length; i++) {
|
||||
|
|
|
@ -62,7 +62,7 @@ var TextLayerBuilder = function textLayerBuilder(options) {
|
|||
this.renderLayer = function textLayerBuilderRenderLayer() {
|
||||
var self = this;
|
||||
var textDivs = this.textDivs;
|
||||
var bidiTexts = this.textContent.bidiTexts;
|
||||
var bidiTexts = this.textContent;
|
||||
var textLayerDiv = this.textLayerDiv;
|
||||
var canvas = document.createElement('canvas');
|
||||
var ctx = canvas.getContext('2d');
|
||||
|
@ -149,7 +149,7 @@ var TextLayerBuilder = function textLayerBuilder(options) {
|
|||
this.divContentDone = true;
|
||||
|
||||
var textDivs = this.textDivs;
|
||||
var bidiTexts = this.textContent.bidiTexts;
|
||||
var bidiTexts = this.textContent;
|
||||
|
||||
for (var i = 0; i < bidiTexts.length; i++) {
|
||||
var bidiText = bidiTexts[i];
|
||||
|
@ -181,7 +181,7 @@ var TextLayerBuilder = function textLayerBuilder(options) {
|
|||
this.convertMatches = function textLayerBuilderConvertMatches(matches) {
|
||||
var i = 0;
|
||||
var iIndex = 0;
|
||||
var bidiTexts = this.textContent.bidiTexts;
|
||||
var bidiTexts = this.textContent;
|
||||
var end = bidiTexts.length - 1;
|
||||
var queryLen = PDFFindController === null ?
|
||||
0 : PDFFindController.state.query.length;
|
||||
|
@ -240,7 +240,7 @@ var TextLayerBuilder = function textLayerBuilder(options) {
|
|||
return;
|
||||
}
|
||||
|
||||
var bidiTexts = this.textContent.bidiTexts;
|
||||
var bidiTexts = this.textContent;
|
||||
var textDivs = this.textDivs;
|
||||
var prevEnd = null;
|
||||
var isSelectedPage = PDFFindController === null ?
|
||||
|
@ -355,7 +355,7 @@ var TextLayerBuilder = function textLayerBuilder(options) {
|
|||
// Clear out all matches.
|
||||
var matches = this.matches;
|
||||
var textDivs = this.textDivs;
|
||||
var bidiTexts = this.textContent.bidiTexts;
|
||||
var bidiTexts = this.textContent;
|
||||
var clearedUntilDivIdx = -1;
|
||||
|
||||
// Clear out all current matches.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue