This is an archived forum post. The information may be outdated. Contact us if you have any questions.

Style file with <base href> in head not being picked up

davemartin wrote on 2012-05-05:
I am using convertHtml to generate a PDF and have it returned to my application. The page being converted includes the use of <base href> in the head section of the page. The style file for the page is based on the base URL being prepended to the style file URL. Example:

<base href="http://devus711.mtnlan.com/" />
<link rel="stylesheet" type="text/css" media="all" href="skins/Default/css/all.css" />

When the page that includes this information is rendered the style file is not being picked up/used as expected. Should the style file be picked up and used when the page is rendered?

I do get the page back without error but it has been created without any styling which of course means it is not correct.

Thanks,
Dave
support wrote on 2012-05-07:
Hello Dave,

thanks for your feedback. It seems that <base> is not supported at the moment. We will look into what can be done about it.
davemartin wrote on 2012-05-08:
Thanks. Any guess on a timeframe?
support wrote on 2012-05-11:
Hello Dave,

we looked into it and we'd like to support it eventually, but we have no immediate plans to implement it.
hlslaughter wrote on 2012-08-29:
This would be very useful for me as well. I have some HTML docs that are behind a firewally, so I'm calling convertHtml(). But the assets are all relative paths, so they never show up in the PDF. Adding a <base> element to <head> could easily fix this if it were supported.

However, you can fix all the paths fairly easily (in PHP) using this: PHP Simple HTML DOM Parser.
support wrote on 2012-08-30:
Thanks for the feedback!