Am 12.10.20 um 00:42 schrieb Joel Hirsh:
I found the following problem.

A pdf has text like "Value:<nbsp>123"
In v.20 that comes through PDFTextStipper.writeString as "Value: 123"
In v.21 that comes through PDFTextStipper.writeString as "Value:<nbsp>1 23"
(extra space between the "1" and the "2")

The nbsp has a width of zero, which is messing up the rest of the string
and inserting an extra space that changes the meaning of the string.
Keeping the nbsp is fine, but it needs to have the same width as a space.

The font here is a type 1 font and the width is coming from

PDFfont.getStandard14Width(code);

Which is in turn calling FontMetrics.getCharacters ("nbsapce") and that is
returning zero.

I don't happen to have source loaded for that, but I assume it's easily
fixable.
Sounds like https://issues.apache.org/jira/browse/PDFBOX-4891

We need to adjust the font metrics for the standard 14 fonts as well.



Regards

JH



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to