Generate PDF with fuelPHP

Generating PDF with fuelPHP is very straight forward using the built in wrappers around TCPDF or DOMPDF (my preferred choice)

First things, configure fuel to use pdf
To generate a PDF with fuelPHP:
$data[‘quote’] = Model_Quote::find($id);
$view = View::forge(‘quotes/print’, $data, false);
$pdf = Pdf::factory(‘dompdf’)->init();

In View file, in views/quotes/print is just plain old HTML and CSS. DOMPDF does a great job of outputting very well formatted PDFs from proper markup.

1 thought on “Generate PDF with fuelPHP”

  1. I search so many website but still can’t have the working example for configuring and generating PDF using FuelPHP. I use TJS-Technology from forum, but there’s still an error in it. using tcpdf, I can’t generate PDF. Using dompdf and load html, I can’t have the correct generated PDF. Can you give detail example to configure and generate PDF using FuelPHP please…, Thanks before.

Leave a Reply

Your email address will not be published. Required fields are marked *