Replies: 5   Views: 5437
The system cannot find the file specified. (code: 2) in [path]\classes\
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 brianbriskey  · 09-04-2018 - 15:29

We have tried all the steps on this thread:

As you can see in the code we create a file just fine. It is the renaming and converting process that bombs out. I have changed the parameters, ran as a script and I am stuck. We added .dll references to the PHP setting per other posts. Restarted the server, no change. I get this error from my test page as well as the example pages that came with the solution. 

We are running PHP on Windows Server. Any help would be appreciated. 

Here is my source code: 

$docx = new CreateDocx();
// enable the compatibility mode to allow the library to warn us in case of using non-compatible content
// add a text to the document
$text = 'Lorem ipsum dolor sit amet, consectetur adipisicing elit';
$docx->addText($text, $paramsText);
// generate the new document
$filename = '/pandp/temp/simpleHTML.docx';
$newname = '/pandp/temp/simpleHTML.pdf';
//make sure new file was created 
if (file_exists($filename)) {
    echo "The file $filename exists";
} else {
    echo "The file $filename does not exist";
$newpdf = new TransformDocAdvLibreOffice();
$newpdf->transformDocument($filename, $newname, '../temp/', array( 'method' => 'script'));