Forum How do I...?

Dynamic image path

swarchi
Hi,

I'm trying to create PDF using Java API but somehow the images got dropped from the PDF. I was able to create PDF along with image using the desktop version however. I hope somebody can shed some lights on this.

My scenario:
CSS:
image
{
content: attr("src", url)
}

XML:
<image src="images\photo1.tif"/>

xml location: http://localhost/test/myfile.xml
image location: http://localhost/test/images/*.tif

Error log shows:
Thu May 20 15:33:13 2010: \images\photo1.tif: warning: can't open input file: No such file or directory
Thu May 20 15:33:13 2010: \images\photo2.tif: warning: can't open input file: No such file or directory

I'm thinking of using full URL in CSS, but keep the path in XML as the relative path. How do I add prefix "http://localhost/test" to the content: attr("src", url) so it will find the images by the full URL?

Maybe I'm missing something, please advice.

Thank you for your time.

- s.w.a
mikeday
Are you passing the full HTTP URL to the input XML file, or using the streaming API? If the latter, you'll need to explicitly set the base URL yourself. Also, URLs should use / slashes not \ slashes.