Thank you, I am trying it out.
Getting error:
Call to a member function getAttribute() on null in <b>xxx/phpdocx-advanced-9.0/classes/CreateDocx.php</b> on line <b>5417</b><br />
Using this:
$docx = new CreateDocxFromTemplate($docx_file); $referenceNode = [ 'type' => 'paragraph' ]; $styles = $docx->getWordStyles($referenceNode);
Checked the code and it looks like this:
$pStyle = $nodeXPath->query($query, $contentNode); if ($pStyle > 0) { $pStyleName = $pStyle->item(0)->getAttribute('w:val');
Did try a var_dump on $pStyle and this is the result:
object(DOMNodeList)#391 (1) {
["length"]=>
int(0)
}
So looks like error in code using:
if ($pStyle > 0) {
Is this maybe fixed in 9.5?