Forum


Replies: 3   Views: 2113
Get text properties from a variable
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  · 25-06-2019 - 15:22

Hello,

We recommend you to check the samples included in the package (DocxPath folder) and the documentation available on https://www.phpdocx.com/documentation/introduction/docxpath. In these samples, you can find a lot of queries, including using custom queries.

For example, the following sample included in the package:

$docx = new CreateDocxFromTemplate('../../files/DOCXPathTemplate.docx');

$referenceNode = array(
    'type' => 'paragraph',
    'contains' => 'level 2 heading',
);

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

print_r($styles);

returns the styles applied to the paragraph that contains level 2 heading. This method returns an array with all styles of the queried content ordered by type.

Regards.