Larry Lynn created PDFBOX-6149:
----------------------------------
Summary: PDFBox makes PDF with different text placement 2.0.x vs.
3.0.x
Key: PDFBOX-6149
URL: https://issues.apache.org/jira/browse/PDFBOX-6149
Project: PDFBox
Issue Type: Bug
Components: FontBox, PDModel
Affects Versions: 3.0.6 PDFBox
Environment: PDFBox 3.0.6, PDFBox 2.0.35, Java 25, unix/Darwin, Redhat
(Corretto)
Reporter: Larry Lynn
We've encountered some text placement issues when creating a PDF using PDFBox
3.0.5 and the GoogleSansText.ttf font. We've done version bisection and
retested on the older PDFBox 2.0.x version and confirmed different PDF box
output using the same code and the same font. Therefore, we suspect a
regression introduced by the 2.x to 3.x major version bump.
Text placement of a footnote anchor is above main body text in 3.x. At first
glance, this looks like a superscript problem, but on closer examination, it
looks like the baseline string has expanded in width. Horizontal differences
between characters suggested a kerning problem to us. However, my colleague
Naga did some exploratory testing and loaded the font with PDTrueTypeFont()
instead of {color:#000000}PDType0Font{color}(). The problem did not reproduce
with PDTrueTypeFont, however, that loader also does not support font
sub-setting, which is a killer feature for us. This led us to believe that a
subsetting regression might be in play.
Our internal continuous integration regression tests produce 100+ PDFs with
various combinations of different fonts. We detected no other changes when we
migrated from PDFBox 2.0.34 to 3.0.5. Therefore, I think that the discrepancy
is specific to the interaction of PDFBox 3.x with this particular font, rather
than any sort of general breakage.
I will provide sample code to demonstrate this issue, along with a protected
version of the font. I also have sample output which I will upload. I've
tested on the highest versions of the 3.x and 2.x branches to demonstrate a
difference.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]