Forum


Replies: 6   Views: 3453
Generatepdf bug
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 andrewk_777  · 08-05-2018 - 19:07

when i use generatePDF function im getting an error:

Deprecated: __autoload() is deprecated, use spl_autoload_register() instead in /home/snterp/public_html/office/_libs/PHPDocx/lib/pdf/dompdf_config.inc.php on line 431

 

if working with

PHP Version 7.2.4

Posted by admin  · 09-05-2018 - 06:16

Hello,

We don't recommend using the generatePDF method. It's a very old method that was replaced by the conversion plugin since phpdocx 4 (https://www.phpdocx.com/documentation/conversion-plugin); as you have an Advanced license, please use the conversion plugin to transform DOCX to PDF.

If you still want to use that old method, we recommend you to hide deprecated messages in the PHP configuration; it's not an error but a deprecated notice. That deprecated messaged with PHP 7.2 was removed in phpdocx 8.

Regards.

Posted by andrewk_777  · 09-05-2018 - 19:07

that does not seem to work either...

im running on linux and setup libreoffice already.

i tried test script:

https://www.phpdocx.com/api-documentation/format-conversion/convert-Word-docx-into-pdf-with-PHP

doxs is created but not pdf. also dont get any errors. any suggestions?

Posted by andrewk_777  · 09-05-2018 - 19:49

actually getting an error now. my code:

require_once $_SERVER['DOCUMENT_ROOT'].'/office/_libs/PHPDocx/classes/TransformDoc.inc';
require_once $_SERVER['DOCUMENT_ROOT'].'/office/_libs/PHPDocx/classes/CreateDocx.inc';


$docx = new TransformDocAdvLibreOffice();
$docx->transformDocument($_SERVER['DOCUMENT_ROOT'].'/office/_tmp/example_text5.docx', $_SERVER['DOCUMENT_ROOT'].'/office/_tmp/example_text5.pdf');

 

ERROR:
Warning: rename(/home/snterp/public_html/office/_tmp/example_text5.pdf,/home/snterp/public_html/office/_tmp/example_text5.pdf): No such file or directory in /home/snterp/public_html/office/_libs/PHPDocx/classes/TransformDocAdvLibreOffice.inc on line 134

and no file is generated

Posted by admin  · 10-05-2018 - 06:44

Hello,

You need to install and configure the conversion plugin correctly, it seems there's some missing rw access; the rename error is a generic problem when the document can't be generated. Please read the information available on:

https://www.phpdocx.com/documentation/conversion-plugin/conversion-plugin-installation-and-set-up

https://www.phpdocx.com/documentation/conversion-plugin/common-problems-and-possible-errors

https://www.phpdocx.com/documentation/conversion-plugin/debugging-libreoffice

to install, debug and solve the most common issues.

After config the conversion plugin, we recommend (as the debugging page explains), to test it using PHP CLI mode.

Regards.

Posted by andrewk_777  · 11-05-2018 - 15:43

Hi,

Thanks for your response. I figured it out. We needed to update libreoffice path in phpdocxconfig.ini file, which was kinda hard to find in any documentation