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:
commit
1886012874
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