2

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.

Mathieu
  • 3,073
  • 1
  • 19
  • 25
Bilal Fazlani
  • 6,727
  • 9
  • 44
  • 90
  • possible duplicate of [download html file as pdf using abcpdf](http://stackoverflow.com/questions/2742375/download-html-file-as-pdf-using-abcpdf) – nhahtdh Jul 16 '12 at 13:11
  • Please see my answer on http://stackoverflow.com/a/11504285/1411950. It succeeds with your task. I've tried to generate pdf from the provided link and the result is OK – Oleg Jul 16 '12 at 12:41

2 Answers2

0

You probably need to increase the timeout so that the javascript has time to finish loading. I'm not sure what the default timeout is but this is the max time that it will wait for the page to render.

doc.HtmlOptions.Timeout = 10000;
tentonipete
  • 5,080
  • 4
  • 25
  • 22
0

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.).

Josh
  • 10,352
  • 12
  • 58
  • 109