|
|
@ -1912,31 +1912,20 @@ var TextLayerBuilder = function textLayerBuilder(textLayerDiv) { |
|
|
|
textDiv.style.top = (text.geom.y - fontHeight) + 'px'; |
|
|
|
textDiv.style.top = (text.geom.y - fontHeight) + 'px'; |
|
|
|
|
|
|
|
|
|
|
|
// The content of the div is set in the `setTextContent` function.
|
|
|
|
// The content of the div is set in the `setTextContent` function.
|
|
|
|
// For debug reasons, do the bidi thing here to compare it later once the
|
|
|
|
|
|
|
|
// text from the getTextContent function comes in.
|
|
|
|
|
|
|
|
var bidiText = PDFJS.bidi(text.str, -1); |
|
|
|
|
|
|
|
textDiv.textContent = bidiText.content; |
|
|
|
|
|
|
|
textDiv.dir = bidiText.direction; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var idx = this.textDivs.push(textDiv) - 1; |
|
|
|
this.textDivs.push(textDiv); |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
this.setTextContent = function textLayerBuilderSetTextContent(textContent) { |
|
|
|
this.setTextContent = function textLayerBuilderSetTextContent(textContent) { |
|
|
|
// When calling this function, we assume rendering the textDivs has finished
|
|
|
|
// When calling this function, we assume rendering the textDivs has finished
|
|
|
|
|
|
|
|
|
|
|
|
var textDivs = this.textDivs; |
|
|
|
var textDivs = this.textDivs; |
|
|
|
|
|
|
|
|
|
|
|
console.log(textContent); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (var i = 0; i < textContent.length; i++) { |
|
|
|
for (var i = 0; i < textContent.length; i++) { |
|
|
|
var textDiv = textDivs[i]; |
|
|
|
var textDiv = textDivs[i]; |
|
|
|
var bidiText = PDFJS.bidi(textContent[i], -1); |
|
|
|
var bidiText = PDFJS.bidi(textContent[i], -1); |
|
|
|
|
|
|
|
|
|
|
|
// console.log("divL #%d: text=%s, bidi=%s, dir=%s", i, textContent[i], textDiv.textContent, textDiv.dir);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
textDiv.textContent = bidiText.content; |
|
|
|
textDiv.textContent = bidiText.content; |
|
|
|
textDiv.dir = bidiText.direction; |
|
|
|
textDiv.dir = bidiText.direction; |
|
|
|
// console.log("divC #%d: text=%s, bidi=%s, dir=%s", i, textContent[i], bidiText.content, bidiText.direction);
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
this.setupRenderLayoutTimer(); |
|
|
|
this.setupRenderLayoutTimer(); |
|
|
|