Skip to content

problem converting docx to pdf #282

@Max75010

Description

@Max75010

Hi

i'm having a problem converting a docx generated by phpword into pdf with mpdf. (you can see issue #210).

Here is the code I'm using :

$phpWord = \PhpOffice\PhpWord\IOFactory::load( UPLOADS_INC . $filename );
$pdfWriter = \PhpOffice\PhpWord\IOFactory::createWriter( $phpWord, 'PDF' );
$pdfWriter->save( UPLOADS_INC . $pdfFilename );

And I keep having this error :

PHP Catchable fatal error: Argument 2 passed to DOMXPath::query() must be an instance of DOMNode, null given, called in /var/www/xxx/PhpWord/Reader/Word2007.php on line 145 and defined in /var/www/xxx/PhpWord/Shared/XMLReader.php on line 99, referer: XXX

Am I doing something wrong ?
I tried to convert a docx that hasn't been generated by phpword and I still have the error.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions