html2pdf.js: Graph not showing in pdf

hello @eKoopmans I used your library and no doubt i have to accept this is the best thing for generating pdf and resolve so many problems of mine code with just 4 5 lines. One thing is giving me a problem which i think missing on my side. When i was using just html2canvas along with jsPDF to generate there were many problems but the chart was printing now after using your library, Chart which is producing in a canvas by Chartjs library it is not printing on pdf. Any solution? this is what i am doing.

var element = document.getElementById('main_data_div'); html2pdf(element, { margin: 0, filename: 'myfile.pdf', image: { type: 'jpeg', quality: 0.98 }, html2canvas: { dpi: 192, letterRendering: true }, jsPDF: { unit: 'in', format: 'a4', orientation: 'l' } });

There is canvas element in my main_data_div

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 21 (10 by maintainers)

Most upvoted comments

@eKoopmans dude, you are the best. I was spending all day trying to figure out why my pdf isn’t rendering the bottom part of my last page. I used your custom html2canvas. Thanks man…saved me alot of headache!

Quick suggestion, maybe for the newbie reactjs devs. In your documentation, mention that it has to be className instead of just “class” when they want to do those divs with the pagebreaks in ReactJs