Created
August 7, 2018 10:25
-
-
Save admicaa/0122f697d38cd1a03caa6cbf67a0cc7b to your computer and use it in GitHub Desktop.
Laravel Snappy, For PDF with Charts.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| namespace App\Http\Controllers; | |
| use Illuminate\Http\Request; | |
| class ChartController extends Controller | |
| { | |
| public function index() | |
| { | |
| $pdf = \PDF::loadView('chartjs'); | |
| $pdf->setOption('enable-javascript', true); | |
| $pdf->setOption('javascript-delay', 5000); | |
| $pdf->setOption('enable-smart-shrinking', true); | |
| $pdf->setOption('no-stop-slow-scripts', true); | |
| return $pdf->download('chart.pdf'); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment