Forum


Replies: 7   Views: 3967
Input file doesn't exist while pdf conversion
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 voripanter  · 29-09-2018 - 19:02

Thank you very much.

This problem is solved now. By using php cli  everything is working.

But now I have another problem, I can't create a docx file. Permission Problem.

Opened Via browser, using httpd/Apache.

I also set the owner of /var/www/ to apache (including subdirs)

Warning: ZipArchive::close(): Failure to create temporary file: Permission denied in /var/www/html/billing/classes/DOCXStructure.php on line 210

 

I don't have this problem on my localhost.

Set 0777 rights to my /tmp folder

<?php

require_once '../classes/CreateDocx.php';



$docx = new CreateDocxFromTemplate('../files/EUR_PHP.docx');


$DATE = 'test';
$INVOICE = 'test';
$AMOUNT = 'test';
$LINE1 = 'test';
$LINE2 ='test';
$docx->enableCompatibilityMode();
$variables = array('DATE' => $DATE, 'INVOICE' => $INVOICE, 'AMOUNT' => $AMOUNT, 'LINE1' => $LINE1, 'LINE2' => $LINE2);
$options = array('parseLineBreaks' => true);

$docx->replaceVariableByText($variables, $options);

$docx->createDocx($INVOICE.'.docx');



//$docx->transformDocument($INVOICE.'.docx', $INVOICE.'.pdf');
//header('Content-type:application/pdf');

//header('Content-Disposition:attachment;filename=$INVOICE".pdf"');

//readfile($INVOICE.'.pdf');
//unlink($INVOICE.'.docx');
//header('Location: /billing/index.php');


?>