Forum


Replies: 7   Views: 265
Tcpdf_parser error: decodefilterflatedecode: invalid code

Posted by admin  · 11-07-2024 - 12:24

Hello,

Thanks for sending the requested information about the license you are using.

Regarding your question, if you are using the namespaces package, you need to set the correct PHP namespace to instantiate a specific class. In the specific case of the TCPDI class, included in TCPDF_lib.php:

$pdf = new Phpdocx\Libs\TCPDI();

or using "use":

use Phpdocx\Libs\TCPDI;

$pdf = new TCPDI();

In any case, please note that phpdocx methods call TCPDF_lib internally. There's no need to generate a TCPDI class unless you need to use a feature not available as phpdocx method or option. For example, to merge PDF documents you can use mergePdf (https://www.phpdocx.com/api-documentation/docxutilities/merge-pdf-documents-with-PHP).

Regards.