Hi, I am struggling with a slow conversion time issue which seems like a timeout exceeded somewhere.
I want to convert a DOCX to PDF using MSWORD, so I am using the transformDocument method. It works fine, but it takes >30sec. I added logs to see what was taking time in the library, specifically in the TransformDocAdvMSWord.php, whish can be summarised like this :
// start a Word instance
$MSWordInstance = new COM("word.application");
// open the source document
$MSWordInstance->Documents->Open($source);
// save the target document
$MSWordInstance->ActiveDocument->SaveAs($target, $code[$filesExtensions['targetExtension']]);
// close Word
$MSWordInstance->Quit();
// free memory
$MSWordInstance = null;
And the guilty is the free memory section, that line alone takes 30 sec.
$MSWordInstance = null;
Meanwhile, the PDF has been created almost instantaneously, but I have no response before that 30 sec.
Dunno if linked but I have "COM Surrogate" processes that stay idle even after conversion, whereas the "word" processes are automatically closed after conversion.
That fixed 30 sec makes me think of a timeout, as if apache couldn't make the COM object end (using apache + php/cgi on windows server).
Do you have an idea ? Thanks in advance !