1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-22 16:18:08 +02:00

Merge pull request #16462 from calixteman/last_elem_TJ

Take into account the final space if any in the TJ command
This commit is contained in:
calixteman 2023-05-23 21:26:58 +02:00 committed by GitHub
commit 1886012874
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 6 deletions

View file

@ -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;