Forum


Replies: 1   Views: 1357
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 bas225522  · 26-01-2021 - 09:58

Hi,

I have a little problem. i have a script to transform .docx to .pdf easy to do with phpdocx... but!

i can't rename the file while transforming the .docx to .pdf

This is the script that i use:

<?php

// Phpdocx inladen.
require_once '../../plugins/phpdocx/classes/CreateDocx.php';

$bestand          = $obj2->bestand; // Get's from db like document.docx
$bestandslocatie  = "documenten/".$obj2->pat_id."/documenten/"; // this is the location where the file is stored
$bestandsnaam     = "output.pdf";

$docx = new CreateDocx();

$docx->transformDocument($bestandslocatie.$bestand, $bestandsnaam, 'libreoffice', array('homeFolder' => '/var/www/html/', 'debug' => true));

?>

than the debug output ( I deleted the save location for security reasons ) 
convert /document.docx -> /document.pdf using filter : writer_pdf_Export

I expect output.pdf but i get document.pdf.
Can anyone tell me what i'm doing wrong?