Forum Bugs

prince is unable to reference web-based images by url

mcgillion
I am trying to include an image in my xhtml which is referenced by a url (because I am generating images dynamically and the process that creates them is on a different server). However Prince is not converting the image and in the log file its says that it "can't open input file".

I dont want Prince to open a file - I want it to source the image from a web server. Here is the error I get when using the command line interface (I am using a test image on the bbc web server for this example):

[root@mdguk pdffromurl]# /usr/local/bin/prince xhtml/hypo_illustration_simple_case.xhtml -s stylesheets/hypo_illustration_print.css

prince: http://newsimg.bbc.co.uk/media/images/41221000/jpg/_41221174_william_gibson_index.jpg: warning: can't open input file: No such file or directory

Here is the "offending" line in my xhtml document:

<img src="http://newsimg.bbc.co.uk/media/images/41221000/jpg/_41221174_william_gibson_index.jpg"/>

If I download the image and reference it as a local file, then Prince converts it correctly - so there is nothing wrong with the image. However it seems that Prince cannot handle "http://" references in the <img> tag.

Is this correct? Perhaps I am doing something wrong?
mikeday
That is correct, Prince does not support HTTP at this time and can only load resources from local files.

We do plan to add HTTP support to Prince in the future.
mikeday
...and the future came sooner than we expected: Prince 5.1 rev 3 supports loading images from HTTP URLs! :D
mcgillion
Hi Mike

Does/will Prince support downloading images via https?

Thanks
Mark
mikeday
No, there is no HTTPS support in Prince at the present time.
mikeday
Update: Prince 6.0 has support for HTTPS and basic HTTP authentication.