Change the format of textContent to be an array

This commit is contained in:
Julian Viereck 2012-09-11 16:14:18 -07:00
parent eced7fbb57
commit 668c2867d4
2 changed files with 4 additions and 16 deletions

View File

@ -507,10 +507,7 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
getTextContent: function partialEvaluatorGetIRQueue(stream, resources, state) {
if (!state) {
state = {
text: '',
mapping: []
};
state = [];
}
var self = this;
@ -528,9 +525,7 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
var res = resources;
var args = [], obj;
var text = state.text;
var chunk = '';
var commandOffset = state.mapping;
var font = null;
while (!isEOF(obj = parser.getObj())) {
if (isCmd(obj)) {
@ -594,20 +589,16 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
// Add some spacing between the text here and the text of the
// xForm.
text = text + ' ';
state.text = text;
state = this.getTextContent(
xobj,
xobj.dict.get('Resources') || resources,
state
);
text = state.text;
break;
} // switch
if (chunk !== '') {
commandOffset.push(text.length);
text += chunk;
state.push(chunk);
chunk = '';
}
@ -618,10 +609,7 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
}
}
return {
text: text,
mapping: commandOffset
};
return state;
},
extractDataStructures: function

View File

@ -1043,7 +1043,7 @@ var PDFView = {
function extractPageText(pageIndex) {
self.pages[pageIndex].pdfPage.getTextContent().then(
function textContentResolved(textContent) {
self.pageText[pageIndex] = textContent.text;
self.pageText[pageIndex] = textContent.join('');
self.search();
if ((pageIndex + 1) < self.pages.length)
extractPageText(pageIndex + 1);