pcorless / icepdf

PDF Rendering and Viewing API in Java
Apache License 2.0
81 stars 21 forks source link

upgrade to fontbox 3.0.2 #349

Closed myroch closed 2 months ago

myroch commented 6 months ago
pcorless commented 6 months ago

I've had some trouble with the early version of fontbox 3 passing the QA suite. I'll give it another got and let you know how it goes. Is there anything thing 3.0.2 you are in need of, fixes some rendering issue?

myroch commented 6 months ago

All jUnits were green, so I hope it will work for you this time. There are definitely some fontbox corrections: https://issues.apache.org/jira/secure/ReleaseNote.jspa?projectId=12310760&version=12353972 I need pdfbox 3.x as we are already on jakarta, so we don't have javax xml bind API anymore. And there should be more fancy stuff in pdfbox 3 as well (writting compressed pdfs as per default, reduced memory usage usw.)

pcorless commented 6 months ago

This library only uses the font-box library to read and render glyphs in fonts. I ran the changes thought the more intense QA test suite I have to test rendering regressions and there are still issues with large chunk of my test suite.
image I"ll need to dig into these font rendering issues to see what's change in the font-box library and figure out why some many glyphs are corrupted. Hopefully it's nothing to crazy as I would like to keep the libraries up to date.

pcorless commented 6 months ago

Looks like the root of the issue is a ConcurrentModificationException. The 2.x version of the library seemed to be a little more thread safe. I'll see what I can do to address this.

myroch commented 6 months ago

ok, I guess PDF rendering, resp. font rendering should happen in single thread only. Hopefully just a test issue.

pcorless commented 5 months ago

Started a conversation with the fontbox people about the regression. I'll keep you posted on how it goes.

pcorless commented 5 months ago

Managed to contact the folks over at fontbox and they have prepped a fix for the issue, https://issues.apache.org/jira/browse/PDFBOX-5819 Should be available in 3.0.3 release.

pcorless commented 2 months ago

Looks like fontbox 3.0.3 was released with fix for multiple threads. I hope you don't mind but I'm going to close this PR as it a duplicate to this ticket https://github.com/pcorless/icepdf/issues/365