-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Open
Milestone
Description
This is:
- [√] a bug report
- [√] a feature request
Expected Behavior
Support EMF image.
Failure Information
Throws PhpOffice\PhpWord\Exception\InvalidImageException exception.
Exception message :
Invalid image: zip:///Users/xxx/Downloads/xxxx.docx#word/media/image.emf
#0 /works/shared/laravel/vendor/phpoffice/phpword/src/PhpWord/Element/Image.php(149): PhpOffice\PhpWord\Element\Image->checkImage()
#1 [internal function]: PhpOffice\PhpWord\Element\Image->__construct('zip:///Users/hu...', NULL, false, 'Picture 18')
How to Reproduce
Document file contains emf format images.
Google emf I got this page: https://fileinfo.com/extension/emf
<?php
use PhpOffice\PhpWord\IOFactory;
$file = '/path/to/file.docx';
$phpWord = IOFactory::load($file);
$sections = $phpWord->getSections();
foreach ($sections as $section) {
$elements = $section->getElements();
foreach ($elements as $element) {
// do something else...
}
}
Context
- PHP version: PHP 7.1.16
- PHPWord version: 0.15.0
tobwen, bfeddern, sohelzerdoumi, begnini, ernst77 and 6 more