Replies: 19   Views: 5711
Issue with transformdocx
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 efenel  · 27-11-2013 - 17:51


I generates a docx and would transform it into pdf like this:

     $docx-> createDocx ($path);

     chmod ($path, 0777. 'docx.');


     / / $docx-> transformDocxUsingMSWord ($path, $path. 'docx.'. 'pdf.');

     $docx-> transformDocx ($path, $path. 'docx.'. 'pdf.');

     chmod ($path, 0777. 'pdf.');

Locally on windows, no problem but on my CentOS 64bit linux server, I get this error in the log message:

phpdocx_logger INFO Running in compatibility mode. Unsupported method.


check.php all is ok

i have installed :

- jre

- glibc.i686, libstdc++.i686, xulrunner.i686

Do you have an idea for solve my problem ?

Posted by jorgelj  · 28-11-2013 - 08:09


Is your script  adding content to a DOCX or you only need to transform DOCX to PDF?


Posted by efenel  · 28-11-2013 - 09:16


Yes, my script add and replace variable by content. Then i transform docx to pdf.

Posted by jorgelj  · 29-11-2013 - 07:49


It seems you're using some method that is not compatible with the plugin transformation like addHTML or addDOCX. Please check this:

If you want to avoid that message you can use class.


Posted by efenel  · 02-12-2013 - 12:32


I try to use the method $docx->enableCompatibilityMode(); who allow use TransformDocAdv but now, i get this error :

Fatal error: Class 'TransformDocAdv' not found in .../lib/PHPDocx/classes/ on line 768

Have you any idea, i need to make it work to buy this library.

Posted by jorgelj  · 02-12-2013 - 13:18


What version of PHPDocX are you using?


Posted by efenel  · 02-12-2013 - 13:48

I use the version 3.5.1 trial.

Posted by efenel  · 02-12-2013 - 13:55

Forgoten : My trial is expired but i need to be sure that it work before buy. 

Posted by jorgelj  · 02-12-2013 - 13:58


The trial version doesn't include the conversion plugin.

You'll only be able to use thie method:

Thats is useful for simple documents.


Posted by efenel  · 02-12-2013 - 16:11

Thanks you but now i have this error :

Warning: ZipArchive::extractTo(): Permission denied in /var/www/***/**/lib/PHPDocx/classes/ : eval()'d code on line 2 Fatal error: Call to undefined function imagecreatefrompng() in /var/www/ims/ims/lib/PHPDocx/pdf/lib/class.pdf.php on line 4204


For try, i have make a chmod 777 -R on folder PHPDocx and on all the document docx.Despite of it the problem persists. :/  

Posted by jorgelj  · 02-12-2013 - 16:31


This error: Fatal error: Call to undefined function imagecreatefrompng comes if your server doesn't include php gd. You just need to install it.


Posted by efenel  · 02-12-2013 - 17:52

Thanks you, i have the error yet :

ZipArchive::extractTo(): Permission denied in /var/www/ims/ims/lib/PHPDocx/classes/ : eval()'d code on line 2

But the pdf is generated (with a bad/incomplete layout :/)

I think, i'm going to buy this library version corporate now but you think i can get a better result than actually with generatePDF()  

Posted by jorgelj  · 03-12-2013 - 08:51


Yes, the corporate version outputs a much better PDF than generatePDF method. If you want attach a DOCX and we'll transform it to PDF so you can see the output.


Posted by efenel  · 03-12-2013 - 10:01


My boss wants a certainty that it will work before investing, here is the config. our server:

Centos 6.4

PHP 5.3.3

Apache 2.2.15

symfony 1.4.19

And what I currently get with generatepdf :/  (version docx good) (version pdf not good)

Thank you to confirm me with my config. PDF conversion work well with corporate version.

Posted by jorgelj  · 03-12-2013 - 11:11


If you attach the DOCX file we'll transform it to PDF using the conversion plugin.

Regards. Jorge.

Posted by efenel  · 03-12-2013 - 11:27

Can you take me a mail address for i can send the docx to you ? (i can't attach here)

Posted by jorgelj  · 03-12-2013 - 12:07


This is the output using the conversion plugin:

As you can see is very similar to the original doc, although one can do some minor changes in the template to get the exact result. We have removed the background image from your document to get a cleaner PDF.


Posted by efenel  · 03-12-2013 - 12:15

ok for me it's good, i show that at my boss and i think we going buy corporate version.

Thank you very much.