How can I run javascript codes, css files and javascript files into wkhtmltopdf in core api project? RRS feed

  • 問題

  • 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?
    2022年6月17日 下午 03:01


  • Try some online tool
    2022年6月20日 上午 11:10
  • If you're like me, you probably use the Chart.js library to draw charts. But you may have noticed that your javascript codes and CSS codes don't work when you try to convert your chart to a PDF. This can be frustrating, but there is a way to make it work.

    The first thing you need to do is make sure you're using the latest version of wkhtmltopdf. As of this writing, that's version 0.12.4. You can download it here.

    Once you have the latest version, open up a command prompt and navigate to the folder where your chart.js file is located. Then, type the following command:

    wkhtmltopdf --javascript-delay 2000 chart.js chart.pdf

    This will generate a PDF of your chart, and the javascript will be executed properly. The 2000 is the number of milliseconds to wait for the javascript to load, so you may need to experiment with that number to get it just right.

    If your CSS isn't working, you can try adding the --print-media-type flag:

    wkhtmltopdf --javascript-delay 2000 --print-media-type chart.js chart.pdf

    This should fix the problem. If not, don't forget to get experts solution.
    2022年7月28日 上午 07:04
  • "Tez Tarrar" channel prominently brings to you all the latest about your capital Delhi. We always try our best to deliver every news to you with authenticity and accurate facts. With our effort and promptness, the news channel has skyrocketed its importance to viewers. Our platform provides all the beats like politics news, crime news, sports news, entertainment news, tech news etc., of News today delhi. Join the fast-paced news channel to be the first to get the correct information about all the latest and important news related to Delhi News Hindi.

    All the viewers and audiences that have been a part of the channel since the beginning, please continue to support us as we bring across every essence of Delhi. The new audiences and everyone who feels that news is part of their routine life subscribe and join our channel for the Latest News Delhi bulletins and reports.  

    Visit Here :-

    2022年7月28日 上午 09:51
  • Tez Tarrar is a vision of bringing across the true facade of Delhi and every news related to the nation’s capital.

    2022年7月28日 上午 09:56
  • Apply Personal Loan Online Instant Approval

    The Insta Loan Services are pre-approved loan services offered by various financial sectors or organizations such as Banks, NBFCs, housing finance companies, etc. Moreover, instant loan services are provided at lower interest rates than other personal or business loans. Apart from this, you can even ask for insta loan services.

    visit here :-

    2022年7月28日 上午 09:57
  • Furthermore, there are reasons behind the consistently increasing demand for instant loans in the market. Firstly, it is cheaper than other loan services.

    2022年7月28日 上午 09:58