Skip to content

Sample 11 ReadWord97 -- Fatal error: Uncaught Error: Class 'PhpOffice\PhpWord\Reader\Style\Font' #1014

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

Closed
Paperclip-Systems opened this issue Mar 6, 2017 · 4 comments

Comments

@Paperclip-Systems
Copy link

Paperclip-Systems commented Mar 6, 2017

I have been having some problems with the ioFactory reading and writing. I am running the current version of php7, and have a clean composer install. I looked over the change log and it appeared the font classes were moved to the common code... so I am not sure what to do from here. Any suggestions would be appreciated.


Sample 11 ReadWord97
07:22:18 Reading contents from resources/Sample_11_ReadWord97.doc

Fatal error: Uncaught Error: Class 'PhpOffice\PhpWord\Reader\Style\Font' not found in /raid/www/dbs_dev/vendor/phpoffice/phpword/src/PhpWord/Reader/MsDoc.php:1693 Stack trace: #0 /raid/www/dbs_dev/vendor/phpoffice/phpword/src/PhpWord/Reader/MsDoc.php(1484): PhpOffice\PhpWord\Reader\MsDoc->readPrl('\xEC\xA5\x01\x01M \t\x04\x00\x00\xF8\x12\xBF\x00\x00...', 3022, 43) #1 /raid/www/dbs_dev/vendor/phpoffice/phpword/src/PhpWord/Reader/MsDoc.php(1114): PhpOffice\PhpWord\Reader\MsDoc->readRecordPlcfBteChpx() #2 /raid/www/dbs_dev/vendor/phpoffice/phpword/src/PhpWord/Reader/MsDoc.php(125): PhpOffice\PhpWord\Reader\MsDoc->readFibContent() #3 /raid/www/dbs_dev/vendor/phpoffice/phpword/src/PhpWord/IOFactory.php(92): PhpOffice\PhpWord\Reader\MsDoc->load('resources/Sampl...') #4 /raid/www/dbs_dev/vendor/phpoffice/phpword/samples/Sample_11_ReadWord97.php(8): PhpOffice\PhpWord\IOFactory::load('resources/Sampl...', 'MsDoc') #5 {main} thrown in /raid/www/dbs_dev/vendor/phpoffice/phpword/src/PhpWord/Reader/MsDoc.php on line 1693

@StoyanPenev
Copy link

Hi @Paperclip-Systems,
just came across the same issue, turned out its due to a missing namespace, just add
use PhpOffice\PhpWord\Style; in the MsDoc.php and you will be good to go.

@piotrkrych
Copy link

@Progi1984 fix it, please, so stupid bug...

@troosan
Copy link
Contributor

troosan commented Jun 27, 2017

This was fixed in pull request #935

@troosan troosan closed this as completed Jun 27, 2017
@asokol-teq
Copy link

Hi all,
Somehow it's in v.0.12.1 but not in v.0.13.0 which is recommended.
Still reproducible under v.0.13.
tnx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

5 participants