Forum How do I...?

Does prince have a problem with Symbolically Linked Images?

shauner
Hi,

I am including an image in my CSS (as a background image for a DIV tag) which is a symbolic link to another image file. If I echo out my XHTML (which is valid) before passing it to Prince it appears without problem. The PDF generates otherwise without a problem, but the image is missing.

Just wondering if someone could confirm if Prince has any problems finding a symbolic link to an image and using that image or if I am barking up the wrong tree trying to find out why it will not display in the generated PDF.

Thanks!

More details about my code:

CSS:
<style type="text/css">
@page {
	  size: US-letter;
	  margin: 0.8in 1in 0.5in 1in;
	  padding: 0;
}
		
#pdf_client_logo {           
           width: 100%;
           height: 50px;
           padding: 0;
	   background: url( {% $URLROOT (smarty constant) %}html/images/client_logo.jpg)  center center no-repeat;
	   border: 0;
}
...


HTML:
...
<div id="pdf_client_logo"></div>
...
mikeday
shauner wrote:
I am including an image in my CSS (as a background image for a DIV tag) which is a symbolic link to another image file. If I echo out my XHTML (which is valid) before passing it to Prince it appears without problem. The PDF generates otherwise without a problem, but the image is missing.

Prince should not have any difficulty with symbolic links to images, as long as the link points to a valid image file that Prince can access.

Is Prince giving any error messages when you process the document? If it fails to load an image file it should produce an error message in the output log stating the problem.

I assume that the {% $URLROOT (smarty constant) %} is being correctly expanded to a valid path by your software before it gets to Prince. Can you try linking to the image directly using the expanded path, like this:

<img src=".../html/images/client_logo.jpg"/>

One last thing, you might want to try placing the image path in quotes, ie. url("..."), in case there is a character in there that is confusing Prince. (If this is the case, it would be helpful if you could tell me the expanded path so that I can check whether Prince is doing the right thing in this case).

Best regards,

Michael