Replies: 4   Views: 1142
Using transformdocument
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 net7  · 29-09-2021 - 14:11

I've exactly the same problem reported here:


..and here:


...and I tried everything was suggested by Admin...with no success.

When I call the function I put the entire path: 

$docx->transformDocument(/Users/zoba-mac/Sites/laravel/storm-laravel/storage/app/n7dg_results/75/c_tracking_badge.docx, /Users/zoba-mac/Sites/laravel/storm-laravel/storage/app/n7dg_results/75/c_tracking_badge.pdf)

I even launched the script on "examples/FormatConversion/transformDocument/libreoffice"...and I got the same error output: "Warning: rename(./transformDocument_libreoffice_1.pdf,transformDocument_libreoffice_1.pdf): No such file or directory in /Users/zoba-mac/Downloads/Storm/SW/phpdocx-premium-10.0-ns/Classes/Phpdocx/Transform/TransformDocAdvLibreOffice.php on line 174"

My /home/.config is 777.

What else is wrong? 




Posted by admin  · 29-09-2021 - 14:31


Your problem doesn't seem the same than the links you point out. For example on the PDF was generated correctly but with a default name instead of the custom one.

The error you get is a generic one when the transformation can't be done ( We recommend you to follow the steps explained on to debug it and run the check-conversionplugin.php script included in the package. The first step is testing LibreOffice standalone, then test using PHP CLI and finally using the web server. The most common source of this error is missing rw access for the home folder of the user that runs LibreOffice. Please note that /home may not be the correct home folder of your user, you can get the correct one running:

echo getenv("HOME");

For further support, please send to contact[phpdocx].com the OS you are using, the version of LibreOffice and the config/phpdocxconfig.ini file of your installation.


Posted by net7  · 29-09-2021 - 15:23

Many thanks you for your fast reply.
I've figured out that my Libreoffice library was outdated: the problem disappeared with last version.

I've just a last little question: is there a way to pass libreoffice installation path dinamically, instead of reading it from the config file?

Posted by admin  · 29-09-2021 - 15:34


You can customize the INI file used as main configuration using the PhpdocxUtilities::$_phpdocxConfig static public variable. For example:

PhpdocxUtilities::$_phpdocxConfig['transform']['method'] = 'libreoffice';
PhpdocxUtilities::$_phpdocxConfig['transform']['path'] = '/opt/libreoffice/program/soffice';
$docx->transformDocument('output.docx', 'output.pdf');

This static variable allows using a single installation for more than one license (the license key can be updated), changing the LibreOffice path dynamically and others.


Posted by net7  · 29-09-2021 - 16:00

Amazing! Thanks a lot!