Forum How do I...?

URLs to fonts and images

Cuberic
How do you declare your font families in css without using an absolute url?

Unless I specify the server name in the url prince can't find any of my images, or fonts that I set in my css file.

In my error log I get the following:
prince: /siv-v3/assets/css/fonts/droid/DroidSans-webfont.woff: warning: cannot open resource
prince: /siv-v3/assets/css/fonts/droid/DroidSans-webfont.ttf: warning: cannot open resource

That's the path directly from the document root. Where does prince start referencing files from? The php file that builds the pdf?
mikeday
Relative URLs are resolved against the URL of the containing document, as you would expect.

If your documents have a file like /foo/bar/font.woff but you want it to be /var/www/site/foo/bar/font.woff then you can specify --fileroot=/var/www/site to rewrite absolute paths to be under your document root.