Forum Bugs

CSS not resolved relative to URL?

facboy
hi,

if I put a css link with a relative path in an html file served over http, it seems that prince does not follow it

<head>
    <title>Test Page</title>

    <link rel="stylesheet" type="text/css" href="my.css">
</head>


I get the error:

my.css: warning: can't open input file: No such file or directory


However it seems that it is fine following js files with a relative path:

<script type="text/javascript" src="my.js"></script>


I can fix this by using the baseUrl option but shouldn't the behaviour be consistent?
facboy
in fact it seems that the baseUrl option does not affect the resolution of javascript files, ie they are always served relative to the html's URL.
mikeday
Is the input document specified using a URL, or are you streaming it directly to Prince via stdin? In the latter case, you need to specify a base URL explicitly.
facboy
oops you're right, i am streaming it via stdin. not thinking clearly, of course the javascript isn't affected because i don't actually enable it.

i'm rendering to static html using phantomjs and then streaming that to prince.