-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
problem converting docx to pdf #282
Comments
Hi @Max75010. I have some questions:
|
Thanks for the reply. I'm using version 0.11.1 - 2 June 2014. |
@Max75010 May be you have a specificity in your DOCX, not working with PHPWord. Could you add a link to your DOCX for tests ? |
Thanks for you replies. Here is a wetransfer to the file (sorry I can't put the direct link but I'm using exactly the same docx) I tried to use a new docx with only a few lines of text, and not generated by phpword, I still have the problem. |
I'm able to run your script with the doc that you sent. This issue probably arise for some system settings. Can you run |
Requirement check: PHP 5.3.0 ... passed I'm having the problem on the first line : $phpWord = \PhpOffice\PhpWord\IOFactory::load( UPLOADS_INC . $filename ); I tried to check if the path was the right path (with is_file()) and there is no problem with it. I also tried to put 777 authorizations on the directory where I put the docx and the files inside but it doesn't change anything. |
Sorry. I forgot that the temp folder check is not yet available in 0.11. See #238. Please create a script with something like this: <?php
var_dump(is_writable(sys_get_temp_dir())); The result should be |
unfortunately, the result is bool(true). |
May be https://github.com/PHPOffice/PHPWord/blob/master/src/PhpWord/Reader/Word2007.php#L144 return false. @Max75010 could you check that ? |
I checked and it returns a DOMDocument object .. |
Could you test with this code here : https://github.com/PHPOffice/PHPWord/blob/master/src/PhpWord/Shared/XMLReader.php#L99
replaced by
|
Now it works ! Thanks a lot ! |
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
Perfect. Bugfix commited in the branch develop. |
👍 |
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.
The text was updated successfully, but these errors were encountered: