Forum


Replies: 3   Views: 284
Tabs in replacevariablebyhtml
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 admin  · 16-08-2023 - 22:02

Hello,

What version of phpdocx are you using? Your username doesn't have any license tied, please send to contact[at]phpdocx.com the username or email of the user that purchased the license you are using.

Custom paragraph styles can be applied to paragraph contents, not to span contents. In the case of replacements, custom paragraph styles are block contents, so inline replacements can't be done to apply them. Please check the following sample included in the package: embedHTML/sample_4.php that illustrates how to use custom styles applied to HTML contents.

To add tabs when transforming HTML, a Premium license with HTML Extended is recommended:

$html = '<span>My text content&amp;#9;with a tab.</span>';
$docx->embedHTML($html, array('useHTMLExtended' => true));
$html = '<span>My text content&amp;#9;with a tab.</span>';
$docx->replaceVariableByHTML('TABS', 'inline', $html, array('useHTMLExtended' => true));

Regards.