I am using the latest phpdocx trial version.
As already mentioned, it happens very randomly. Sometimes I have to execute the script multiple times with the same docx and then it works.
$docx->addText($string, array('pStyle' => 'berschrift1'));
🏷️ Limited Offer: 25% OFF 🏷️
First 100 purchases only — Special discount!
Use this coupon on checkout: PHPDXPJ_D1SC1N5T
Get it now