Forum


Replies: 2   Views: 3453
Error with compatibility mode when transforming document
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 AndrewCooper  · 24-06-2016 - 09:46

Hi,

I've used phpdocx to create a Word Document.  I've done this using the merge docx feature so that I can have multiple headers and footers in the document. Now I need to take the merged document and transform it into a PDF.  I'm doing this by doing the following...

$docx = new CreateDocx();

$docx->transformDocument("myfile.docx", "myfile.pdf");

When doing this, I get the following error and the PDF is not created. Any ideas?

Running in compatibility mode. Unsupported method.

Posted by AndrewCooper  · 24-06-2016 - 11:48

Okay... I think I found the problem.  In CreateDocx.inc on line 5331 (in the transformDocument() function) there is this line.

if (!$this->_compatibilityMode) {
    throw new \Exception('Running in compatibility mode. Unsupported method.');
}

Why is the "!" negation operator there?  If _compatibilityMode is set to false it is going to throw an Exception that says it is running in compatibility mode.  That doesn't make any sense to me.