Forum


Replies: 7   Views: 445
Tcpdf_parser error: decodefilterflatedecode: invalid code
Topic closed:
Please note this is an old forum thread. Information in this post may be out-to-date and/or erroneous.
Every phpdocx version includes new features and improvements. Previously unsupported features may have been added to newer releases, or past issues may have been corrected.
We encourage you to download the current phpdocx version and check the Documentation available.

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.