Skip to content

uncaught exception BadMethodCallException #472

Closed
@clarkk

Description

@clarkk

docx file

http://www.filedropper.com/141228magmafaktura334andershermansen

require_once \Ini::get('path/class').'/third-party/phpword/Autoloader.php';
\PhpOffice\PhpWord\Autoloader::register();

\PhpOffice\PhpWord\Settings::setPdfRendererPath(\Ini::get('path/class').'/third-party/tcpdf');
\PhpOffice\PhpWord\Settings::setPdfRendererName('TCPDF');

$word = \PhpOffice\PhpWord\IOFactory::load($file_dst);
$writer = \PhpOffice\PhpWord\IOFactory::createWriter($word, 'PDF');
$writer->save($tmp_file);

error

PHP Fatal error: Uncaught exception 'BadMethodCallException' with message 'Cannot add PreserveText in Cell.' in /var/www/dyntest.dk/class/third-party/phpword/Element/AbstractContainer.php:276
Stack trace:
#0 /var/www/dyntest.dk/class/third-party/phpword/Element/AbstractContainer.php(119): PhpOffice\PhpWord\Element\AbstractContainer->checkValidity('PreserveText')
#1 [internal function]: PhpOffice\PhpWord\Element\AbstractContainer->addElement('PreserveText', '{ =SUM(ABOVE) }', NULL, Array)
#2 /var/www/dyntest.dk/class/third-party/phpword/Element/AbstractContainer.php(101): call_user_func_array(Array, Array)
#3 /var/www/dyntest.dk/class/third-party/phpword/Reader/Word2007/AbstractPart.php(137): PhpOffice\PhpWord\Element\AbstractContainer->__call('addPreserveText', Array)
#4 /var/www/dyntest.dk/class/third-party/phpword/Reader/Word2007/AbstractPart.php(137): PhpOffice\PhpWord\Element\Cell->addPreserveText('{ =SUM(ABOVE) }', NULL, Array)
#5 /var/www/dyntest.dk/class/third-party/phpword/Reader/Word2007/AbstractPart.php(294): PhpOff in /var/www/dyntest.dk/class/third-party/phpword/Element/AbstractContainer.php on line 276


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions