Forum


Replies: 3   Views: 126
Using getwordstyles with a type

Posted by jeremie  · 16-07-2024 - 15:01

getWordStyles only works with type "default".

The following code works well and returns a list of styles:

$docx = new CreateDocxFromTemplate($document_word);
$referenceNode = array(
         'type' => 'default',
);
$styles = $docx->getWordStyles($referenceNode);

But any other $referenceNode returns an empty $styles for instance:

$referenceNode = array( 'type' => '*' );
$referenceNode = array( 'type' => 'paragraph' );
$referenceNode = array( 'type' => 'paragraph', 'contains' => 'Hello world' );

It used to work properly with version 9. I'm using version 12 and it doesn't work anymore.

What am I missing?