Welcome Guest Search | Active Topics | Sign In | Register

HTML to PDF CSS Background images working locally but not live Options
Richard
Posted: Wednesday, October 24, 2012 8:40:59 AM
Rank: Newbie
Groups: Member

Joined: 10/24/2012
Posts: 2
Testing out your product on a website, and for some strange reason, it is generating perfect PDFS when i run this site locally (local host) but when uploaded to a live domain background css images are not being rendered.
eo_support
Posted: Wednesday, October 24, 2012 8:51:10 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,195
Hi,

That has to do with your HTML. You will need to fix that. Whether your file is local or on a remote server doesn't matter much to the converter. The converter will render it as long as it can access it.

Thanks!
Richard
Posted: Wednesday, October 24, 2012 8:56:40 AM
Rank: Newbie
Groups: Member

Joined: 10/24/2012
Posts: 2
Thanks for the fast reply.

Could this be to do with the base URL, i assume it can access the file because the rest of the CSS is fine. and the image is accessible when i put the link in a browser

background: url(/file.axd?pointerid=caaed3ec50364a079d5e272e3e328cf1) no-repeat 0px 0px;

this is the CSS which woks fine locally but not live.
eo_support
Posted: Wednesday, October 24, 2012 9:08:44 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,195
Hi,

If you use ConvertHtml then you MUST set BaseUrl correctly. If you use ConvertUrl then BaseUrl does not matter. If you use ASPXToPDF then ASPXToPDF will automatically set BaseUrl (ASPXToPDF calls ConvertHtml) so you do not have to worry about it.

There are a number of situations where a file will render in your browser but not with the converter. The most common scenario is when your site requires login and your browser has already logged in, where as the converter is not; Another scenario is your HTML works fine with IE but does not work well with other browsers. Try to use Google Chrome to verify your HTML and see if that works. Our rendering engine works most like Google Chrome.

If none of those helps, use an img tag to render the image, modify the image path, and also check your IIS log to see where the problem is. The converter has a full blown browser engine embeded so it should have no problem handling any kind of images a browser can handle. So it got to be either the wrong path, or something is wrong on your server side causing it not to render correctly (for example, a permission issue causing your IIS to refuse serving file.axd, or a bug in your file.axd that crashes when requested by the converter, etc).

Thanks!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.