Forum


Replies: 1   Views: 2024
Change font-size for document
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  · 13-08-2020 - 15:45

Hello,

Changing font sizes on-the-fly of existing documents depends on how they are set.

If they are set using only the default style, you can use setDefaultFont (https://www.phpdocx.com/api-documentation/layout-and-general/set-default-font-Word-document-with-PHP) or setDocumentDefaultStyles (https://www.phpdocx.com/api-documentation/layout-and-general/set-document-default-styles-Word-document-with-PHP). setDocumentDefaultStyles is available since phpdocx 8.0, we recommend you to upgrade your license to be able to use this method.

If font sizes are set as custom styles or run-of-content styles, then you need to use DOCXCustomizer (https://www.phpdocx.com/api-documentation/docxcustomizer/customize-docx-Word-documents-PHP), but it's only available in Premium licenses.

Regards.