vandeseer / easytable

Small table drawing library built upon Apache PDFBox
MIT License
239 stars 91 forks source link

Doesn't work with PDFBox 3.0.0-alpha3 #148

Closed erirapce closed 6 months ago

erirapce commented 1 year ago

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.

vandeseer commented 1 year ago

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 ...

erirapce commented 1 year ago

Thanks for letting me know! :)

adsafawqew commented 10 months ago

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

henkka14 commented 10 months ago

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

https://github.com/apache/pdfbox/commit/2d529f94b17a3f23aa8b2f566bc33947a91c245a

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)

jsimomaa commented 7 months ago

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

vandeseer commented 6 months ago

Thanks for your PR once again @jsimomaa! :+1:

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.

vandeseer commented 6 months ago

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