Welcome Guest Search | Active Topics | Sign In | Register

Sometimes CSS isn't used in the creation of a PDF Options
Lisbeth
Posted: Tuesday, January 8, 2019 4:39:11 AM
Rank: Newbie
Groups: Member

Joined: 1/8/2019
Posts: 1
We use EO.pdf to create PDF versions of HTML pages.
With the HTML there is also CSS, and we've experienced, that we always get a PDF, but sometimes the styling is incorrect.

Is there any opportunity of getting error feedback, if something goes wrong - fx if some files aren't accessible to EO.pdf?
eo_support
Posted: Tuesday, January 8, 2019 1:07:57 PM
Rank: Administration
Groups: Administration

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

In order to resolve the style issue, first you must find out why the styles are not rendered ---- most of the time it's because the files are not accessible.

If you have determined that the issues are caused by the fact that the files are not accessible, you can modify your page to accommodate such situation. One way to do this is to use JavaScript to check whether certain styles exist and if it does not exist, you can then load some "backup" style sheet. However whatever logic you wish to perform is perform INSIDE your web page, not on the converter. The converter is basically just a general browser engine that renders the page the same way as a regular browser --- and handle errors such as missing styles exactly the same way as a regular browser. It is not practical for us to expose interface for you to implement custom handler because there are numerous scenarios that a web page can go "wrong" (this is exactly why a browser engine is so complex) so it's not possible for us to expose them to you. As such you will need to rely on existing technologies such as JavaScript to handle such scenario.

To facilitate such task, we provide the following property:

https://www.essentialobjects.com/doc/eo.pdf.htmltopdfoptions.jsinitcode.aspx

This property allows you to inject whatever JavaScript code you wish to any page you want to convert without having the modify the page itself.

Hope this helps. Please feel free to let us know if you still have any questions.

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.