I'm using Apache Fop to generate a pdf document that includes a PDF417 barcode, and when i use the command line it works:
fop -fo source.fo -pdf result.pdf
But when I use the Java alternative, the barcode appears blank and the log show these warnings:
Unknown formatting object "{http://barcode4j.krysalis.org/ns}barcode" encountered (a child of fo:instream-foreign-object}. (See position 88:1266)
Unknown formatting object "{http://barcode4j.krysalis.org/ns}pdf417" encountered (a child of barcode}. (See position 89:45)
I've included these dependencies in Maven:
<!-- https://mvnrepository.com/artifact/org.apache.xmlgraphics/fop -->
<dependency>
<groupId>org.apache.xmlgraphics</groupId>
<artifactId>fop</artifactId>
<version>2.1</version>
</dependency>
<!-- https://mvnrepository.com/artifact/net.sf.barcode4j/barcode4j -->
<dependency>
<groupId>net.sf.barcode4j</groupId>
<artifactId>barcode4j</artifactId>
<version>2.1</version>
</dependency>
What I'm missing?
Thanks in advance!
The answer was very simple, instead of using the maven dependecy:
<!-- https://mvnrepository.com/artifact/net.sf.barcode4j/barcode4j -->
<dependency>
<groupId>net.sf.barcode4j</groupId>
<artifactId>barcode4j</artifactId>
<version>2.1</version>
</dependency>
I needed to use:
<!-- https://mvnrepository.com/artifact/net.sf.barcode4j/barcode4j-fop-ext -->
<dependency>
<groupId>net.sf.barcode4j</groupId>
<artifactId>barcode4j-fop-ext</artifactId>
<version>2.1</version>
</dependency>
Pretty obvious now. Thanks to myself! :)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With