Hello,
The previous script was tested using phpdocx Corporate 5.5, classic package. If we test the same script using phpdocx Corporate 5.5 namespaces package:
<?php
require_once 'phpdocx/5.5/namespaces/Classes/Phpdocx/Create/CreateDocx.inc';
$docx = new Phpdocx\Create\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');
The output is the same. We have opened the DOCX output with MS Word 2007 to MS Word 2016 and LibreOffice 6 using PHP 5.6, PHP 7.0, PHP 7.1 and PHP 7.2 and the style is correctly applied in all cases.
We recommend you to check if Tidy is installed and enabled, and test the same script using the trial package of phpdocx 9 (https://www.phpdocx.com/download_trial). And also test the samples available on the documentation page (https://www.phpdocx.com/documentation/introduction/html-to-word-PHP).
Regards.