Hi,
We'd need both PDF files to tell what difference there is. If you can't
share the files, then you'll need to use PDFDebugger and look at the
content stream and compare.
Tilman
On 22.07.2024 11:25, Jens Hohmuth wrote:
Hi,
we’re in the process of converting our PDF creation from using Apache
FOP to Apache PDFBox.
To verify, if the output is nearly identical we use Ghostscript to
convert the PDF to png and then use ImageMagick to compare both png
files at the pixel level.
In general this works excellent and the expectation is that we
generate the same png output when everything is using exactly the same
settings.
However, we do notice some slight differences in the font output
between FOP and PDFBox which I don’t have an explanation for.
It looks like there is some kind of anti aliasing going on in the
generated PDF file. These differences are displayed as a red outline
but for some glyphs there are only partial differences.
Please see the attached link with an example image. We output the word
“Auftragsdetails” with the exact same font and output position and
still see these weird partial differences at the outer edges of
individual glyphs (Please note that the font is rendered regulary and
in black color in both cases. The difference is only at the outer edge
of the glyphs which ImageMagick shows in red).
Bildschirmfoto-2024-07-22-um-10-46-31.png
Bildschirmfoto-2024-07-22-um-10-46-31 hosted at ImgBB
<https://ibb.co/4S84j2c>
ibb.co <https://ibb.co/4S84j2c>
<https://ibb.co/4S84j2c>
I was under the impression that PDF stores the plain text, the font
and possibly transformation information. But the image looks like
there are differences in individual glyphs. They are slightly bigger
in either FOP or PDFBox but not all of them which is weird.
Does anyone have any hints or an explanation of what this could be?
I’m puzzled.
Thank you very much for your help and PDFBox in general!
Best regards
Jens
PS: I would understand if the outlines are all to the left or the
right or top or bottom since this would mean the text rendering
position is slightly off but here it’s kinda all over the place.