Forum Bugs

Java wrapper setBaseURL

mrossi
Hello,

I'm experimenting with conversions of a HTML to PDF using the Java wrapper convert(inputStream, OutputStream) method. I specify the base URL with the setURL(String) method. I'm using it to set the base URL to

file:///C:/Users/auser/Desktop/inline-editing/

This folder contains the CSS mentioned in the HTML via <link type="text/css" rel="stylesheet" href="t1.css">, so the full path of the CSS is

C:\Users\auser\Desktop\inline-editing\t1.css

The log file says

Tue Jul 24 17:54:41 2012: ---- begin
Tue Jul 24 17:54:41 2012: Loading document...
Tue Jul 24 17:54:41 2012: C:\Users\auser\Desktop\t1.css: warning: can't open input file: No such file or directory
Tue Jul 24 17:54:41 2012: Converting document...
Tue Jul 24 17:54:41 2012: finished: success
Tue Jul 24 17:54:41 2012: ---- end

Prince is searching one folder level too high in the hierarchy, which I cannot understand

Some suggestions?
mikeday
The base URL should be the actual URL that the document would have, so something like this:
file:///C:/Users/auser/Desktop/inline-editing/mydoc.html

This option is commonly interpreted as "base directory", which it is not; we may need to add an alternative --basedir option instead.
mrossi
That's what I discovered myself after posting the issue and before your reply :)