Welcome Guest Search | Active Topics | Sign In | Register

ConvertHtml with CSS? Options
James McConnell
Posted: Tuesday, March 13, 2012 10:49:54 AM
Rank: Newbie
Groups: Member

Joined: 3/13/2012
Posts: 3
Greetings! I am starting to use your software as evaluation for a project for my company, and what I've seen so far is very impressive. I have a question concerning support for converting a chunk of HTML to PDF, and it has to do with CSS. I will have a need to convert a large chunk of HTML (which is actually a grid containing report data) to PDF, and we would like to convert the HTML as it exists on the page so that the state of the grid (such as grouping and collapsing of rows) is maintained, but if I'm reading the documentation correctly, this won't include any CSS definitions, so the HTML would convert without styling.

I know that I could use ConvertUrl, and I will if I have to, but that would mean extra work on my end to ensure that some state information about the grid is maintained (which is outside the scope of PDF conversion, I understand). So I'm looking to see if there is support for CSS using the ConvertHtml functionality. Is it a matter of including the <link> tags in the HTML that is sent to the conversion method? I appreciate any and all responses. Thanks, and great product!

James McConnell
eo_support
Posted: Tuesday, March 13, 2012 10:56:12 AM
Rank: Administration
Groups: Administration

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

You need to set HtmlToPdf.Options.BaseUrl. That's the base url to be used to resolve all relatives Urls in your page, such as link, a, img, etc.

Thanks!
James McConnell
Posted: Tuesday, March 13, 2012 10:59:17 AM
Rank: Newbie
Groups: Member

Joined: 3/13/2012
Posts: 3
I see, I think that just might solve my issue! I'll have to get in there and mess with some code, but that sounds like it should do what I need it to do, which would save me a lot of work in the long run. Thank you for the very fast response, very much appreciated!
eo_support
Posted: Tuesday, March 13, 2012 11:08:02 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
You are very welcome. Please feel free to let us know if you have any more questions.

Thanks!
James McConnell
Posted: Tuesday, March 13, 2012 4:14:19 PM
Rank: Newbie
Groups: Member

Joined: 3/13/2012
Posts: 3
Just wanted to let you know this worked like a charm!
eo_support
Posted: Tuesday, March 13, 2012 4:32:54 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Great. Glad that it works for you!


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.