vandeseer / easytable

Small table drawing library built upon Apache PDFBox

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Doesn't work with PDFBox 3.0.0-alpha3

erirapce opened this issue · comments

It return this error: java.lang.NoClassDefFoundError: Could not initialize class org.vandeseer.easytable.structure.Table.
The dependency is imported correctly in the pom file.

Hey @erirapce,
Thanks for reporting. Didn't yet try it with the new version of PDFBox. Also not quite sure whether I will find enough time to support it ...

Thanks for letting me know! :)

problem is org.vandeseer.easytable.structure.Table line 19:

private static final PDFont DEFAULT_FONT = PDType1Font.HELVETICA;

should be replaced with:

private static final PDFont DEFAULT_FONT = PDType1Font(FontName.HELVETICA);

PDType1Font.HELVETICA doesn't exist anymore
tested with pdfbox v3.0.0

Hey yes, I've been having this issue as well as the static initializers were removed

apache/pdfbox@2d529f9

I was initially thinking this could work for both v2.x.x and v3.0.0, but it seems that Standard14Fonts.FontName is not yet available in v2.x.x, meaning that I've not found a way to support both pdfbox versions v2 and v3 simultaneously

https://github.com/apache/pdfbox/blob/2.0.29/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/Standard14Fonts.java
https://github.com/apache/pdfbox/blob/3.0.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/Standard14Fonts.java

(note I am not contributor to the repo, but I just use pdfbox actively)

I created a PR that should fix this issue as PDFBox v3 has been released

Thanks for your PR once again @jsimomaa! 👍

I upgraded the develop branch. It supports PDFBox 3 now. A release will hopefully follow shortly.
However, I decided to only support PDFBox 3 with the next release. Supporting both at the same time wouldn't make much sense given the complexity involved.

Just released version 1.0.0 which is basically the same code base but upgraded to support PDFBox 3 and Java 11.