Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using TCPDF as an engine through CakePDF

Tags:

cakephp

tcpdf

I'm using Ceeram's CakePDF plugin on CakePHP 2.2. It makes generating PDFs using Cake's layouts and views very easy and for the most part I have not had any problems with it.

However, I want to be able to access some of the more advanced features of TCPDF, specifically the barcode features.

If I was using TCPDF directly, I could just do $pdf->writeBarcode(); but as I'm using TCPDF as an engine in the CakePDF Plugin, I'm not sure how to go about accessing it, or if it's even possible.

$CakePdf->writeBarcode(); doesn't work, but then I wouldn't really have expected it to. There is nothing in Ceeram's docs that mentions it, though.

like image 624
Joseph Avatar asked Mar 16 '26 06:03

Joseph


1 Answers

It does not support that by default, it just converts your view into a rendered PDF, but it won't let you access the "advanced" functionalities of your PDF Engine. Of course you are always free to extend the plugin to do allow this feature. I reckon you'd have to add it in the Pdf/CakePdf.php class file to get it to work.

like image 198
Oldskool Avatar answered Mar 19 '26 05:03

Oldskool



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!