Forum


Replies: 2   Views: 1798
Transformdocadvmsword #timememoryfunctionlocation
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 dev-info  · 24-06-2020 - 06:44

hello, 

in localhost,

when I create a docx document, then I transform it into pdf (with msword), I end up with this error:
TransformDocAdvMSWord.php on line 117 Call Stack #TimeMemoryFunctionLocation 10.0009252616 {main}

the code:

$strContent = "<p>test</>";

       $docx = new Phpdocx\Create\CreateDocx();

       $docx->embedHTML($strContent);

       if(!file_exists($racine)){

        mkdir($racine, 0777, true);

       }

       $docx->createDocx($racine."FIRST_PAGE_GB");

       $docx>transformDocument($racine.'FIRST_PAGE_GB.docx', $racine.'FIRST_PAGE_GB.pdf', 'msword');

The .ini config:

[transform]

method = "msword"

path = "C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXE"

 

someone has any idea what's going on?

 

Thank you

Posted by dev-info  · 24-06-2020 - 06:54

in fact, the problem is: in the background, the msword process remains open after a transform, and therefore in the next document it is no longer available. How to embellish the msword process after a transformation?

Posted by admin  · 24-06-2020 - 07:19

Hello,

Please kill all existing MS Word processes using the Task manager and then try running the same code standalone using PHP CLI mode, so you can isolate the problem.

Please note, as explained on https://www.phpdocx.com/documentation/conversion-plugin/common-problems-and-possible-errors (MS Word common problems and issues section) that using the msword method requires:

Source and target files must use absolute paths: 'C:\\folder\\source.docx' .

You need to use absolute paths in source and target options, and also note that \\ (double backslash) may be required to separate the path folders in Windows servers.

Regards.