Evening,
I have been trying to convert a simple docx to pdf using libreoffice. I can create the initial docx using the classes but converting does not appear to be working. Please see code below. Am I missing something.
This is the error I am getting when I convert
Warning: rename(./demo_2ad473d4f6f51e1232f00e7724503e10.pdf,demo_conversion_2ad473d4f6f51e1232f00e7724503e10.pdf): No such file or directory in/Applications/XAMPP/xamppfiles/htdocs/securesign/library/phpdocx/classes/TransformDocAdvLibreOffice.inc on line 131
Here is the code I am using
// We instantiate the CreateDocx class in a new object
require_once 'library/phpdocx/classes/CreateDocx.inc';
// Create the initial document
$docx = new CreateDocx();
$text = 'This is a test document';
$docx->addText($text);
// Save the document
$fileType = 'pdf';
$suffix = md5(microtime());
$filename = 'demo_' . $suffix;
$docx->createDocx($filename);
$newFilename = 'demo_conversion_'. $suffix .'.' . $fileType;
$docx = new TransformDocAdvLibreOffice();
$docx->transformDocument($filename.'.docx', $newFilename, null, array('method' => 'script'));
unlink($filename . '.docx');