score:1

i think your problem is not with html2pdf but the error is with the events sequence to create the html2pdf. what i understand doing events as:

1.  loading php code
2.  loading according to php and creating charts/canvas through js
3.  pringing html2pdf output through php code

the real problem is that step no.3 is not waiting for completion of step no.2. thus, you have to create a trigger/event to start step no.3 on completion of step no.2. generally the html2pdf are created through js as under:

score:2

as the error message hints for: you'd have go to html2pdf on github and create a new issue there; in order to have tag canvas added into the next one release of the library - or try to use something else than a canvas to render the chart; other charting-libraries would also work with tag div or svg.

well, see issue 372 ...the author does not intent to add tag canvas.

therefore, you could only work around, eg. with phantomjs, to create a screenshot of the canvas and then use that as static image resource, in order to render it to pdf.


Related Query

More Query from same tag