user3242861
user3242861

Reputation: 1929

Laravel - How to generate pdf reports

I'm developing an app that have a view with 3 table and 3 chart, I'm using framework bootstrap and chart.js. So my problem is that I need to allow to download this view as PDF file.

To do that I'm trying to use this : https://github.com/barryvdh/laravel-dompdf but it returns 8 empty pages and don't give me any error and I don't understand why.

The code to generate the pdf is that:

$pdf = PDF::loadView('backend.letter', compact('letter', 'stems', 'branches', 'hiddenStems', 'luckyStems', 'luckyBranches', 'hiddenStemsLuky', 'luckyYears'));
return $pdf->download('letter.pdf');

Anyone can help me?

Thank you

Upvotes: 0

Views: 4776

Answers (1)

Sophannareth Noy
Sophannareth Noy

Reputation: 11

I think you should try https://github.com/barryvdh/laravel-snappy with wkhtmltopdf installed. This package has more functions and supports than DomPDF.

Upvotes: 1

Related Questions