1

I have an HTML page which I want to convert to pdf. the page rendered in the browser without any problem. but it not rendered correctly when I use Nreco pdf generator. How can I debug javascript in the page which is rendering in Nreco pdf generator? I found HtmlToPdf_LogReceived event in pdf generator class. but I can't catch console.log message in this event. how can I pass a message from javascript and receive it on the server side? Is there any straight approach to debug javascript in HTML page in NReco pdf generator?

Hamed Mahdizadeh
  • 936
  • 1
  • 15
  • 29

2 Answers2

0

I found my problem. NReco does not support the default value for the function parameter.

    function updateData(source, remove = true) {
    //...
    }

I did not test my code on IE. After running code on IE11, I found this problem.

Hamed Mahdizadeh
  • 936
  • 1
  • 15
  • 29
0

You found correct way to get wkhtmltopdf's console log output by handling "LogReceived" event. However, to get js errors you need to specify "--debug-javascript" option:

var htmlToPdf = new NReco.PdfGenerator.HtmlToPdfConverter();
htmlToPdf.CustomWkHtmlArgs = " --debug-javascript ";
Vitaliy Fedorchenko
  • 8,447
  • 3
  • 37
  • 34