Forum


Replies: 6   Views: 763
How can i get superscript and subscript from getwordcontent?
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  · 21-03-2023 - 06:14

Hello,

getWordStyles returns an array with the styles applied to the content. You need to iterate this array to check if it contains the style (vertAlign):

Subscript and superscript. <vertAlign w:val="superscript"/>.
The single attribute is val. Permitted values are:

baseline - regular vertical positioning
subscript - lowers the text below the baseline and changes it to a small size
superscript - raises the text above the baseline and changes it to a smaller size

We recommend you check the samples included in the package (examples/DocxPath/getWordStyles folder) and the API documentation page (http://www.phpdocx.com/api-documentation/docx-path/get-styles-word-contents-in-docx).

Regards.