ABCPdf add javascript document

Can I add JavaScripts documents to a generated PDF using ABCPdf?

+5
source share
2 answers

If you mean Javascript that runs after the document has been loaded, check out this documentation page .

doc.HtmlOptions.UseScript = true;
doc.HtmlOptions.GeckoSubset.OnLoadScript =
@"(function() {
   window.ABCpdf_go = false;

   // your javascript code here

   window.ABCpdf_go = true;
})();";
+3
source

I think you should be able to. There are some settings in C # that will help.

You need to install

doc.HtmlOptions.UseScript = true; 

this will run javascript.

it might be worth setting a timeout to give it more time to complete the download

doc.HtmlOptions.Timeout = 10000;

and I always had better results with the gecko rendering engine.

doc.HtmlOptions.Engine = EngineType.Gecko;
+1
source

All Articles