danfickle / openhtmltopdf

An HTML to PDF library for the JVM. Based on Flying Saucer and Apache PDF-BOX 2. With SVG image support. Now also with accessible PDF support (WCAG, Section 508, PDF/UA)!
https://danfickle.github.io/pdf-templates/index.html
Other
1.93k stars 359 forks source link

Breaking Changes #940

Open rmcarls1 opened 1 year ago

rmcarls1 commented 1 year ago

We attempted to upgrade to the new major versions of xmpbox (version 3.0.0) and pdfbox-app (version 3.0.0) today but one or both of them introduce breaking changes in openhtmltopdf.

matmannion commented 1 year ago

https://pdfbox.apache.org/3.0/migration.html

The problems I'm seeing are mostly due to "Static instances for Standard 14 fonts removed";

java.lang.NoSuchFieldError: COURIER_BOLD_OBLIQUE
    at com.openhtmltopdf.pdfboxout.fontstore.AbstractFontStore$BuiltinFontStore.addCourier(AbstractFontStore.java:55)
    at com.openhtmltopdf.pdfboxout.fontstore.AbstractFontStore$BuiltinFontStore.createInitialFontMap(AbstractFontStore.java:43)
    at com.openhtmltopdf.pdfboxout.fontstore.AbstractFontStore$BuiltinFontStore.<init>(AbstractFontStore.java:38)
    at com.openhtmltopdf.pdfboxout.PdfBoxFontResolver.<init>(PdfBoxFontResolver.java:82)
    at com.openhtmltopdf.pdfboxout.PdfBoxRenderer.<init>(PdfBoxRenderer.java:204)
    at com.openhtmltopdf.pdfboxout.PdfRendererBuilder.buildPdfRenderer(PdfRendererBuilder.java:69)
    at com.openhtmltopdf.pdfboxout.PdfRendererBuilder.buildPdfRenderer(PdfRendererBuilder.java:57)
    at ai.nakhoda.create.template.services.pdf.PdfBoxUtils$.$anonfun$usingPdfRenderer$1(PdfBoxUtils.scala:233)
    at monix.eval.internal.TaskEvalAsync$EvalAsyncRegister.$anonfun$apply$1(TaskEvalAsync.scala:45)
    at monix.execution.schedulers.TracingRunnable.run(TracingRunnable.scala:33)
    at monix.execution.internal.InterceptRunnable.run(InterceptRunnable.scala:27)
    at monix.execution.internal.forkJoin.AdaptedForkJoinTask.exec(AdaptedForkJoinTask.scala:29)
    at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:373)
    at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1182)
    at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1655)
    at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1622)
    at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:165)
korndog commented 11 months ago

@matmannion The latest version of xmpbox (version 3.0.1) now works. However, the latest version of pdfbox-app (version 3.0.1) still breaks openhtmltopdf. Please advise.

matmannion commented 11 months ago

I'm not involved with it but this fork of openhtmltopdf supports pdfbox 3.0 https://github.com/imario42/openhtmltopdf

korndog commented 11 months ago

@matmannion Very interesting! What was the main reason for the new fork???

matmannion commented 11 months ago

There's some discussion here which is how I became aware of it https://github.com/danfickle/openhtmltopdf/issues/921

funyin commented 4 months ago

I'm not involved with it but this fork of openhtmltopdf supports pdfbox 3.0 https://github.com/imario42/openhtmltopdf

Thanks @matmannion . That worked for me