Forum


Replies: 3   Views: 3870
Target path ignored when using 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 lewisrblack  · 16-04-2015 - 14:08

When using the transformDocument method, the target path seems to be ignored, and the converted file is always stored in my web root. My code is as follows. $docx = new CreateDocx(); $docx->enableCompatibilityMode(); $text = 'Lorem ipsum dolor sit amet, consectetur adipisicing elit'; $docx->addText($text, $paramsText); $docx->createDocx(DOC_DIR . '/test.docx'); $docx->transformDocument(DOC_DIR . '/test.docx', DOC_DIR . '/test .pdf'); The test.docx is created in the correct directory, but then the converted PDF is saved in the wrong directory. The output from the debugger is; convert /Library/WebServer/Documents/my_website/docs/test.docx -> /Library/WebServer/Documents/my_website/test.pdf using filter : writer_pdf_Export As you will see it has created the docx in /my_website/docs/ but the converted pdf is saved in /my_website Any suggestions would be welcome as to why the converted file is being saved in the wrong directory. Thanks, Lewis