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  · 22-03-2023 - 08:28

Hello

The following line:

$referenceNode = array(
    'type' => 'paragraph',
 
);

$stylecontents = $docx->getWordStyles($referenceNode);

returns the styles applied to the whole paragraph. Maybe the style you want to query is not applied to the whole paragraph but to a run-of-text content in the paragraph.

As detailed on the documentation page:

type      string  * (all, default value), chart, image, default, list, paragraph (also for links and lists), run, style, table, table-row, table-cell or a custom tag.

Maybe you need to query by run type, not paragraph.

Regards.