0
votes

I'm referring to the problem and my answer in the following post: image in PDF from Apache FOP 1.1 with Java. I'm trying to display a background image (sort of a watermark) on every page:

<fo:region-body margin="0mm 25mm 15mm 25mm" background-image="url('image.png')" background-position-vertical="center" background-repeat="no-repeat"/> 

I got it working on my machine from both Eclipse and exported jar as described in above mentioned post but it does not work on machines others than mine. It always says that the format is not supported.

Image not available. URI: image.png. 
Reason: org.apache.xmlgraphics.image.loader.ImageException: 
The file format is not supported. No ImagePreloader found for image.png (No context info available)
org.apache.xmlgraphics.image.loader.ImageException: 
The file format is not supported. No ImagePreloader found for image.png

I'm using the FOP 1.1 jars from the FOP website and added them all to my clathpass. Also export them all together with the jar. I'm running out of ideas for solutions. Is FOP using some system libraries that are installed on my machine but not on the others? Maybe as a workaround: is it possible to insert the image programatically from java?

1
It works on some machines, but not on others - does this mean FOP runs on various machines to create the JAR? If so, I recommend checking for differences in the FOP configuration files. Graphic filters, etc. are configured there.Dabbler
What I mean was that the creation of the PDF with this very image, only works properly on one machine. The PDF is created on every machine but the image is missing. This problem only occurs if the jar is launched.Rick

1 Answers

0
votes

According to Apache FOP in a Java Applet - No ImagePreloader found for data and the https://stackoverflow.com/a/26282077/4092205 answer, it could be a problem with your xml-graphics-commons library plugin registry configuration.