Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Highchart render in pdf generated using PHP mPdf

Can anybody suggest me what should I do ? I am generating the PDF report and in the report, I have to print the high chart graph. As high chart uses the javascript which will not execute in PDF file, So I have to create the graph on the server.

I read many posts, they suggest me that i have to create the image of that graph, but my question is how will I create the image to that graph ?

like image 780
Ajai Avatar asked Jun 24 '26 12:06

Ajai


1 Answers

You could try using server-side "browser" or JS engine to generate your graphs; there are tools that can be used for that.

For that purpose I used those:

  • PhantomJS: some quirks regarding header/footers but a nice lot of examples on website
  • WkHTMLToPDF: highly customisable, but I had trouble setting timeouts properly so graphs are fully generated before PDF output

But there are others.

like image 156
Preuk Avatar answered Jun 27 '26 01:06

Preuk