mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-22 16:18:08 +02:00
Change the format of textContent to be an array
This commit is contained in:
parent
eced7fbb57
commit
668c2867d4
2 changed files with 4 additions and 16 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue