We have run the following script using phpdocx 5.5:
$docx = new CreateDocx(); $docx->embedHTML(' <html> <head> </head> <body style="color: red"> <p>This is a test.</p> <p>Another test which must be separated in a specific paragraph.</p> <p>And another</p> </body> </html>'); $docx->createDocx('output.docx');
And the color is applied correctly to all paragraphs. As you are using a template maybe it has some custom style or any other content that is overwriting the new contents/styles. We recommend you to check your template.