|
Rank: Member Groups: Member
Joined: 8/12/2011 Posts: 16
|
Hi, We're very pleased so far with our testing of EO.Pdf. But we tested with one of our customers reports, which contains CSS rules in a <style media="print">-tag. EO.Pdf seems to ignore these rules, which perhaps is the correct way since creating a PDF isn't necessarily the same as printing a page. But we need to somehow have different CSS-rules for when viewing a page, and when creating a PDF of it. Is there any way to do this with EO.Pdf? It doesn't have to be with media="print".
Thanks!
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi, The HTML to PDF converter does not render it as "print", so it will ignore media="print" rules. One easy way is to use different CSS files and then swap the CSS file. If you are generating the HTML text, then you can code to use a different CSS file when you pass the text to the converter; If you do not wish to do that, you can put some JavaScript code in your page to detect whether the page is running inside our converter, then switch the CSS file if you see it's inside the converter. See here for more details on how to detect our converter with JavaScript: http://doc.essentialobjects.com/library/4/htmltopdf/eo_js.aspxHope this helps. Please feel free to let us know if you have any more questions. Thanks!
|
|
Rank: Member Groups: Member
Joined: 8/12/2011 Posts: 16
|
Hi,
We solved it with the JavaScript option.
Thanks alot!
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Great. Thanks for the update!
|
|