Search code examples
c#asp.nethtmlpdfabcpdf

Convert HTML to PDF with ABCpdf


I am creating an web application which uses ABCpdf to convert an html page to pdf. The html page uses javascript for some dynamic parts..

I have already tried setting the UseScript bool to true as follows :

theDoc.HtmlOptions.UseScript = true;

It renders static text and omits javascript content.

The URL I tried to convert is : https://developers.google.com/chart/interactive/docs/examples (just for example)

Any help on converting javascript enabled pages to pdf would be really appreciated.


Solution

  • Some HTML to PDF creators require fully qualified paths for everything from images to javascript files. This is usually due to the creator opening a web request in the background and capturing the rendering silently. But this only works when everything is fully qualified. I've had the same problem with ExpertPDF. Try fully qualifying all resources (images, css, javascript, etc.).