Forum


Replies: 7   Views: 1653
How to create heading with formatstyles in embedhtml?
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  · 07-12-2020 - 16:24

Hello,

UPDATE: https://www.phpdocx.com/documentation/cookbook/working-with-headings

The headingLevel option sets the paragraph as heading (w:outlineLvl tag in the DOCX). If you want to apply also a heading style you need to set the pStyle option available in the same method.

Methods such as addHeading or embedHTML using heading tags (h1, h2, h3...) adds heading paragraphs with a custom paragraph style by default. The custom paragraph style applied can be the default ones included in phpdocx, generated from scratch using the API methods (https://www.phpdocx.com/documentation/practical/styles), or imported from a template.

Regards.