Forum


Replies: 3   Views: 810
Docx variable using replacevariablebywordfragment
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  · 12-05-2022 - 05:52

Hello,

The getWordStyles metod return styles used by contents, but its structure can't used directly with WordFragments, you'd need to parse the styles and generate and array with the styles to be applied.

The recommended approach to autodetect and apply the existing styles in a placeholder when replacing it by a WordFragment is using a Premium license with the stylesReplacementType option.

Regards.