While trying to create barcode with: barcode4j-fop-ext-complete.jar, locally on my computer with command ..\fop-2.5-bin\fop-2.5\fop\fop.bat -c config1.xml -xml 6314587.xml -xsl stylesheet.xsl output.pdf, I get this error:
Exception in thread "main" java.lang.IncompatibleClassChangeError: class
org.krysalis.barcode4j.fop0205.BarcodeElementMapping can not implement
org.apache.fop.fo.ElementMapping,
because it is not an interface (org.apache.fop.fo.ElementMapping is in unnamed module of loader 'app')
Did anyone encounter this problem? How can I fix it?
Is the stylesheet I have barcode implementation as below:
<fo:block-container>
<fo:block>
<fo:block>
<fo:instream-foreign-object>
<barcode:barcode xmlns:barcode="http://barcode4j.krysalis.org/ns" message="123" orientation="90">
<barcode:code128>
<barcode:height>8mm</barcode:height>
</barcode:code128>
</barcode:barcode>
</fo:instream-foreign-object>
</fo:block>
</fo:block>
</fo:block-container>
Use a maintained barcode4j fork: https://github.com/SingingBush/barcode4j (the barcode4j-cli jar is built when you clone and do a mvn build)
And then do something like: