Hello,
HTML can be transformed to Word as a WordFragment, just as almost any other content, to be added to documents.
We think you have three approaches to accomplish what you need:
· Use the wordStyles option available when importing HTML. On https://www.phpdocx.com/documentation/introduction/html-to-word-PHP you can check some samples about how to use this option.
· Clone the heading as many times as needed (https://www.phpdocx.com/api-documentation/docx-path/clone-elements-in-docx) and add the HTML as WordFragment (https://www.phpdocx.com/documentation/practical/wordfragments-and-wordml) using DOCXPath (https://www.phpdocx.com/api-documentation/docx-path/insert-elements-in-docx) or a custom placeholder.
· Add the content and use DOCXCustomizer (https://www.phpdocx.com/documentation/introduction/docxcustomizer) to set the heading styles to the strings you need. This feature is only available in Premium licenses.
Regards.