PHPOffice / PHPPresentation

A pure PHP library for reading and writing presentations documents
https://phpoffice.github.io/PHPPresentation
Other
1.3k stars 519 forks source link

throw Excpetion 'Feature not implemented (l.811 : fcc' when read ppt #450

Open tianlai0910 opened 6 years ago

tianlai0910 commented 6 years ago

Feature not implemented (l.811 : fcc in /home/parallels/web/composer/vendor/phpoffice/phppresentation/src/PhpPresentation/Reader/PowerPoint97.php:811

qihuajun commented 6 years ago

Encountered same problem:

PHP Fatal error:  Uncaught exception 'Exception' with message 'Feature not implemented (l.811 : fcc' in /vagrant/pdf/vendor/phpoffice/phppresentation/src/PhpPresentation/Reader/PowerPoint97.php:811
Stack trace:
#0 /vagrant/pdf/vendor/phpoffice/phppresentation/src/PhpPresentation/Reader/PowerPoint97.php(618): PhpOffice\PhpPresentation\Reader\PowerPoint97->readRecordDocumentContainer('\x0F\x00\xE8\x03\xB1\x1C\x00\x00\x01\x00\xE9\x03(\x00\x00...', 8)
#1 /vagrant/pdf/vendor/phpoffice/phppresentation/src/PhpPresentation/Reader/PowerPoint97.php(439): PhpOffice\PhpPresentation\Reader\PowerPoint97->loadPowerpointDocumentStream()
#2 /vagrant/pdf/vendor/phpoffice/phppresentation/src/PhpPresentation/Reader/PowerPoint97.php(418): PhpOffice\PhpPresentation\Reader\PowerPoint97->loadFile('/vagrant/tzl.pp...')
#3 /vagrant/pdf/ppt.php(12): PhpOffice\PhpPresentation\Reader\PowerPoint97->load('/vagrant/tzl.pp...')
#4 {main}
  thrown in /vagrant/pdf/vendor/phpoffice/phppresentation/src/PhpPresentation/Reader/PowerPoint97.php on line 811

The ppt I loaded was a pptx file at first and was saved as a ppt file, hope this clue can help.

mikevang commented 3 years ago

I'm having this same issue. Pptx files load fine, but any ppt that I try throws this error.

flyke commented 11 months ago

I keep having the same error no matter what .ppt file I throw at it.

$pptReader = \PhpOffice\PhpPresentation\IOFactory::createReader('PowerPoint97');
$presentation = $pptReader->load($path_to_file);

Results in errors like: PhpOffice\PhpPresentation\Exception\FeatureNotImplementedException: The feature is not implemented. Please create an issue.

I tried it on latest 1.0.0 version and latest dev version.

If any of the developers can confirm that they can successfully read one .ppt file, could you please share that specific .ppt file perhaps so I can use that one for testing in my code ?

Also, it would be nice if there was a way to read the parts that the code can read, and just ignore and skip stuff that the code cannot read instead of stopping and throwing a FeatureNotImplementedException. At least this would yield a usable result. There might be cases where the code can actually read more than 90% of the .ppt file but fails due to a single FeatureNotImplementedException.

In my case I just want to parse an uploaded .ppt file and extract the plain text from it. This will be used to perform in-document searches. A general getAllText() function or something for the Reader would be awesome.

Progi1984 commented 11 months ago

Could you give us a sample file for improving the library ?

flyke commented 10 months ago

Could you give us a sample file for improving the library ?

Sure, Got this example file from the internet myself. Had to zip it becaus github would not allow me to directly upload a .ppt file. Example 1: file_example_PPT_500kB.zip Example 2: pptexamples.zip