Forum


Replies: 7   Views: 2554
Replacevariablebyhtml css render with root tag not working
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 Bouillou  · 06-05-2019 - 11:47

OK, it is working if I define the font size in each <p> with a <span> like example below. This font size definition is very useful when working with template because the size of the font is the same as the rest of the static text in the document.

But, it would be better to define the real font size of the Normal style in the <body>. So, is there a way to retrieve the font size of the Normal style of a template in order to set it like <body style='font-size: ??px'> ?

<?php

require_once '../../../classes/CreateDocx.php';

$docx = new CreateDocx();

$docx->embedHTML('
<html>
<head>
</head>
<body style="color: red;">

<p><span style="font-size:initial">This is a test.</span></p>
<p><span style="font-size:initial">Another test which must be separated in a specific paragraph.</span></p>
<p><span style="font-size:initial">And another</span></p>

</body>
</html>');

$docx->createDocx('output');

Best regards,

Sébastien