Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

vvr's avatar
Level 1

TCPDF for Lumen

Hi.

Im triying to use the library TCPDF in my Lumen project but for the two methods I try, no one works.

-First via composer I add the TCPDF library directly but I can't reference the TCPDF class directly (I even try to add namespaces to the tcpdf.php file but dosen't work) So always I usually get the "TCPDF class not found".

-Second, via composer too, the Laravel package (https://packagist.org/packages/elibyy/tcpdf-laravel ) but I get a lot of composer errors because the Illuminate package that Lumen hasen't.

Any one knows some package or fork?

0 likes
2 replies
MaxMatteo's avatar

just pull in the normal lib from composer

and use it with a prepended \ (this tells the autoloader to look in the global namespace)

like: \TCPDF

1 like

Please or to participate in this conversation.