I am generating ones PDF
with DomPDF
and Laravel
, all good to generate.
The drawback is that you need to display graphics in the PDF
, and I had never used that library, and I find the novelty that it does not "accept" javascript
so everything got out of hand.
I have been trying to use some configurations that I have seen on the Internet, but they do not work for me, so I resort to this medium, hoping that someone has had the same problem and was able to solve it.
I use Charjs for graphics.
use"barryvdh/laravel-dompdf": "^0.8.6",
I know that there are other libraries but I would like to continue using DomPDF
, since I am generating many pdf
and adapting to another that may ask for changes, it would be very heavy for me due to the number of things that I would have to modify, if there is one that allows me to do what I need (graficos)
and suits the way you work dompdf
I would appreciate help with a name.
You can use Quickchart . Dompdf can render images, and Quickchart gives you that, images and works with Chartjs.
If in Chartjs you have a chart like this (Example from the documentation):
To get the image with quickchart, you simply have to do:
Later, in your blade template, you only attach the image with the path that quickchart gives you.