I use the Chart.js library to draw charts, but I use the wkhtmltopdf library to convert pdf. But my javascrip codes and css codes are not working. How can I make it work?
I use the Chart.js library to draw charts, but I use the wkhtmltopdf library to convert pdf. But my javascrip codes and css codes are not working. How can I make it work?
Do you mean you create a web page and use Chart.js to draw charts, before using the wkhtmltopdf library to convert pdf, everything works well (the JS and CSS code), but after using the wkhtmltopdf library to convert the html page to pdf, the JS and CSS code will not work, right? If that is the case, this issue relates to the wkhtmltopdf library, you can contact the wkhtmltopdf team, whether it supports the JS and CSS file when convert to pdf.
Thank you for your comment. I added kods my project but not working chart.js. I couldn't find the answer to this question anywhere. This is my detail question. https://stackoverflow.com/questions/72668882/how-can-i-run-javascript-codes-css-files-and-javascript-files-into-wkhtmltopdf.
You misunderstand Web API, MVC, and the wkhtmltopdf library. Web API returns data, usually JSON, not an HTML View. MVC returns an HTML View. Seems logical to me that a library with "HTML to PDF" in the name does not work with Web API.
the links to css and js files must be either full url with server (and no security) or absolute file paths (relative path are not supported with string input html
what do your links look like?
5 people are following this question.