DownloadFluency/mPDF
mPDF wrapper. Check mPDF website for further details
Using in Symfony2
Add the bridge classes to container config.
mPDF container config
<parameters>
<parameter key="fluency_office.mpdf.factory.class">Fluency\Bridge\MPdf\MPdfFactory</parameter>
<parameter key="fluency_office.mpdf.provider.class">Fluency\Bridge\MPdf\MPdfProvider</parameter>
</parameters>
<services>
<service id="fluency_office.mpdf.factory" class="%fluency_office.mpdf.factory.class%"/>
<service id="fluency_office.mpdf.provider" class="%fluency_office.mpdf.provider.class%">
<argument type="service" id="fluency_reports.mpdf.factory" />
</service>
<service id="mpdf.factory" alias="fluency_office.mpdf.factory"/>
<service id="mpdf.provider" alias="fluency_office.mpdf.provider"/>
</services>
Generate PDF files from controllers.
$mpdf = $this->get('mpdf.provider');
$mpdf->getMPdfInstance()->WriteHTML(
'Some HTML Text or $this->render(your_twig_view)->getContent()'
);
return $mpdf->getMPdfResponse();
|