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.
Please provide a sample pdf. Use a sharehoster or something similar as the mailing list doesn't allow (binary) attachments.




Regards

JH



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: users-h...@pdfbox.apache.org

Reply via email to