We migrated from pdfbox 2 to 3 in our software recently and noticed, that the mustang library broke in the process. Since I didn't want to roll the changes back in our software I decided to migrate pdfbox in your project, too.
Be aware, this PR has breaking changes. I had to replace all load() functions with one that accepts a "File" object, since the signature of the PreflightParser changed significantly (eg:PreflightParser.validate(pdfFile).isValid()). I don't know why the Parser is so much more flexible by using RandomAccessRead-classes, but the PreflightPrarser lacks such constructors.
Due to this change I had to change getResourceAsStream to getResource, which should be fine, since the tests don't run in a jar-file.
Additionally I had to modify some tests, because getDocumentInformation is mostly deprecated. The producer can't be set using it anymore:
Suggestion: -> mustang version 3 could get rid of the "library" only proving the "validator" and then also the preflight check could be tackled by verapdf which would be always available
We migrated from pdfbox 2 to 3 in our software recently and noticed, that the mustang library broke in the process. Since I didn't want to roll the changes back in our software I decided to migrate pdfbox in your project, too.
Be aware, this PR has breaking changes. I had to replace all load() functions with one that accepts a "File" object, since the signature of the PreflightParser changed significantly (eg:
PreflightParser.validate(pdfFile).isValid()
). I don't know why the Parser is so much more flexible by using RandomAccessRead-classes, but the PreflightPrarser lacks such constructors.Due to this change I had to change getResourceAsStream to getResource, which should be fine, since the tests don't run in a jar-file.
Additionally I had to modify some tests, because getDocumentInformation is mostly deprecated. The producer can't be set using it anymore:![image](https://github.com/ZUGFeRD/mustangproject/assets/146177709/257a245f-053b-4b52-8f8a-73d851006dfe)
See also: PDFBox Migration Guide