Forum


Replies: 1   Views: 1353
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 admin  · 26-01-2021 - 10:43

Hello,

LibreOffice generates a PDF output with the same name than the source document and PDF as extension. phpdocx renames it to the new name ($target value) using rename PHP function (if you open TransformDocAdvLibreOffice.php you can find the following line:

rename($newDocumentPath, $target);

As the target may depend on the target folder too, maybe you need to set the destination folder in the path too (if the script that does the transformation isn't in the same folder as the DOCX or it doesn't have rw access to move the file to the new destination):

$docx->transformDocument('/path/document.docx', '/path/document.pdf');

We recommend you to print both variables in TransformDocAdvLibreOffice.php (rename($newDocumentPath, $target); line). Or you can generate the PDF and then rename/move it to the new destination using rename in your code.

Regards.