Forum


Replies: 2   Views: 3815
Transformdoc::generatepdf() does not find dompdf class
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 by_lexus  · 26-04-2012 - 07:48

Hi,

Your example:
[code]
require_once 'classes/TransformDoc.inc';

$document = new TransformDoc();
$document->setStrFile('Text.docx');
$document->generatePDF();
[/code]

does not work in PHP 5.3: The function "DOMPDF_autoload()" in phpdocx/pdf/dompdf_config.inc.php is never called.

This can be downtracked to the following lines:

[code]
// Line 383 in dompdf_config.inc.php:
// If PHP >= 5.3 the $prepend argument is available
else if ( version_compare(PHP_VERSION, '5.3', '>=') ) {
spl_autoload_register($autoload, true, true);
}
[/code]

If the spl_autoload_register is called with "false" as 3rd parameter, it works:

[code]
spl_autoload_register($autoload, true, false);
[/code]

It seems like an order issue in calling spl_autoload_register in another part of the program.

Please add this as a bug, as it is not working as you suggested in PHP 5.3.

regards
alex