Replies: 6   Views: 194
Setdefaultfont method on existing document text
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  · 27-05-2022 - 14:51


On you can read the supported styles for each element. The font style is supported in paragraph and run elements; other element types don't support changing the font style ('*' is a particular selector that means all elements from the supported ones, so the easiest approach is setting exact types).

Also note this method includes the target option:

target string document (default), style, lastSection, header, footer.

By default, the target is document, but you can also set the following targets: style, header, footer.

Please check the samples included in the package (examples/DOCXCustimizer folder), that illustrate how to use DOCXCustomizer.