pdfbox-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From John Hewson <j...@jahewson.com>
Subject Re: PDFBox 2.0 and Batik
Date Tue, 10 May 2016 17:52:18 GMT

> On 10 May 2016, at 08:47, Ivan Ridao Freitas <info@ivanrf.com> wrote:
> I'm trying to add an SVG to a PDF with Apache Batik, but some code changes made it incompatible
with PDFBox 2.0.1.

Batik does not depend on PDFBox so an incompatibility there is not possible.

> The first exception is: java.lang.NoSuchMethodError: org.apache.fontbox.cff.CFFFont.getProperty(Ljava/lang/String;)Ljava/lang/Object;

You’re running code which was compiled for PDFBox 1.8 but using a 2.0 jar. That’s not
going to work.

> I tried to manually override the class to add that, and the next errors where:
> - CFFCharset was moved to the parent package, so I added import org.apache.fontbox.cff.charset.CFFCharset;
> - I had to make the setCharset() public

There are numerous API differences between 1.8 and 2.0, you’ll likely have to make some
changes to your code. We have a migration guide here: http://pdfbox.apache.org/2.0/migration.html
> Nevertheless, although I could make a workaround there, a simple SVG without fonts enters
in long loop conversion that never finishes. Also, I don't know why Batik loads all system
fonts and fails on fonts stuff, but my SVG has no fonts inside :(.

I don’t know how you’re using Batik, but problems with it are not related to PDFBox.

— John

> Ivan

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message