Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Image not Found- XSL-FO

Tags:

xml

xsl-fo

XSL-Fo can't retrieve my image though I've set the correct path to the image.

<fo:external-graphic src="../graphics/bullet.png" content-height="0.5cm" />

I received this error on each attempt the file was processed via Windows's command prompt.

org.apache.fop.events.LoggingEventListener processEvent
SEVERE: Image not found. URI: bullet.png. (See position 26:80)
org.apache.fop.events.LoggingEventListener processEvent                                                       
SEVERE: Image not found. URI: bullet.png. (No context info available)
org.apache.fop.events.LoggingEventListener processEvent                                                                                

The source path is the exact format provided by APACHE's FOP image example. I even executed their "image.fo" file on rendering external graphics, and still encountered the error above(with different image file).

Are there alternative solutions?

like image 632
maudff Avatar asked Sep 20 '25 09:09

maudff


1 Answers

Relative URIs are relative to the base URI (https://xmlgraphics.apache.org/fop/fo.html#external-resources).

If you're not setting the base URI in your FOP config, the base URI is the current directory (https://xmlgraphics.apache.org/fop/1.1/configuration.html).

Where is the image file relative to the directory in which you're running FOP?


Does it work when you use:

<fo:external-graphic src="examples/fo/graphics/bullet.png" content-height="0.5cm" />

?

like image 194
Tony Graham Avatar answered Sep 23 '25 10:09

Tony Graham