The pdf is getting generated ok but the javascript has not run even though I've set the enableJavascript parameter of the LoadFromHTML method to true. My code looks a bit like this:
- Code: Select all
PdfDocument doc = new PdfDocument();
var url = "http://localhost:90/index/1234";
// create the pdf
var thread = new Thread(() => doc.LoadFromHTML(url, true, true, false));
thread.SetApartmentState(ApartmentState.STA);
thread.Start();
thread.Join();
// return the pdf result
doc.SaveToHttpResponse("Results.pdf", httpResp, HttpReadType.Open);
doc.Close();
httpResp.Close();
The page "localhost:90/index/1234" which we are trying to convert to pdf has a reference to AngularJS:
- Code: Select all
<script type="text/javascript" src="/content/lib/angular.min.js"></script>
and some simple javascript that to populate some data.
The page works fine in the browser but the javascript does not run when converting to PDF.
Any suggestions?
Thanks
Craig