Description
I had a word doc and I used the sample. Sample_11_ReadWord2007.php to see it it worked. It returned an error
22:16:05 Reading contents from /var/www/getverified/V/PHPWord/samples/resources/Sample_11_ReadWord2007.docx
22:16:05 error ...exception 'BadMethodCallException' with message 'Cannot add PreserveText in Section.' in /var/www/getverified/V/PHPWord/src/PhpWord/Element/AbstractContainer.php:228
Stack trace:
#0 /var/www/getverified/V/PHPWord/src/PhpWord/Element/AbstractContainer.php(130): PhpOffice\PhpWord\Element\AbstractContainer->checkValidity('PreserveText')
#1 [internal function]: PhpOffice\PhpWord\Element\AbstractContainer->addElement('PreserveText', '{ FORMCHECKBOX ...', NULL, Array)
#2 /var/www/getverified/V/PHPWord/src/PhpWord/Element/AbstractContainer.php(112): call_user_func_array(Array, Array)
#3 /var/www/getverified/V/PHPWord/src/PhpWord/Reader/Word2007/AbstractPart.php(139): PhpOffice\PhpWord\Element\AbstractContainer->__call('addPreserveText', Array)
#4 /var/www/getverified/V/PHPWord/src/PhpWord/Reader/Word2007/AbstractPart.php(139): PhpOffice\PhpWord\Element\Section->addPreserveText('{ FORMCHECKBOX ...', NULL, Array)
#5 /var/www/getverified/V/PHPWord/src/PhpWord/Reader/Word2007/Document.php(160): PhpOffice\PhpWord\Reader\Word2007\AbstractPart->readParagraph(Object(PhpOffice\PhpWord\Shared\XMLReader), Object(DOMElement), Object(PhpOffice\PhpWord\Element\Section))
#6 /var/www/getverified/V/PHPWord/src/PhpWord/Reader/Word2007/Document.php(58): PhpOffice\PhpWord\Reader\Word2007\Document->readWPNode(Object(PhpOffice\PhpWord\Shared\XMLReader), Object(DOMElement), Object(PhpOffice\PhpWord\Element\Section))
#7 /var/www/getverified/V/PHPWord/src/PhpWord/Reader/Word2007.php(94): PhpOffice\PhpWord\Reader\Word2007\Document->read(Object(PhpOffice\PhpWord\PhpWord))
#8 /var/www/getverified/V/PHPWord/src/PhpWord/Reader/Word2007.php(69): PhpOffice\PhpWord\Reader\Word2007->readPart(Object(PhpOffice\PhpWord\PhpWord), Array, 'Document', '/var/www/getver...', 'word/document.x...')
#9 /var/www/getverified/V/PHPWord/src/PhpWord/IOFactory.php(78): PhpOffice\PhpWord\Reader\Word2007->load('/var/www/getver...')
#10 /var/www/getverified/V/PHPWord/samples/Sample_11_ReadWord2007.php(13): PhpOffice\PhpWord\IOFactory::load('/var/www/getver...')
#11 {main}
i then thought maybe its my document so i used the document from the sample - for checkboxes - it did the same thing.
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.