mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-22 16:18:08 +02:00
Take into account the final space if any in the TJ command
The final space was just ignored and that led to wrongly position the next chunk of text.
This commit is contained in:
parent
094fb3c783
commit
a76a69e1ed
2 changed files with 10 additions and 6 deletions
|
@ -3074,7 +3074,7 @@ class PartialEvaluator {
|
|||
const spaceFactor =
|
||||
((textState.font.vertical ? 1 : -1) * textState.fontSize) / 1000;
|
||||
const elements = args[0];
|
||||
for (let i = 0, ii = elements.length; i < ii - 1; i++) {
|
||||
for (let i = 0, ii = elements.length; i < ii; i++) {
|
||||
const item = elements[i];
|
||||
if (typeof item === "string") {
|
||||
showSpacedTextBuffer.push(item);
|
||||
|
@ -3096,11 +3096,6 @@ class PartialEvaluator {
|
|||
}
|
||||
}
|
||||
|
||||
const item = elements.at(-1);
|
||||
if (typeof item === "string") {
|
||||
showSpacedTextBuffer.push(item);
|
||||
}
|
||||
|
||||
if (showSpacedTextBuffer.length > 0) {
|
||||
const str = showSpacedTextBuffer.join("");
|
||||
showSpacedTextBuffer.length = 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue