Hello
I am creating pdf with graph in a laravel application by using wkhtmltopdf. Everything is working fine in my local system but I am facing issue on my production server.
Showing error -
QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-www-data' qt.qpa.screen: QXcbConnection: Could not connect to display Could not connect to any X display.Working environment - Ubuntu 18.04
My code is like -
use mikehaertl\wkhtmlto\Pdf
$render = view('chart')->render();
$pdf = new Pdf;
$pdf->addPage($render);
$pdf->setOptions(['javascript-delay' => 5000]);
$pdf->saveAs(public_path('report.pdf'));
return response()->download(public_path('report.pdf'));
I am unable to find the solution for this issue.
Please help me.
Thanks and regards
Rahul Sharma