Perforce Chronicle 2012.2/486814
API Documentation
|
Filter to convert a Microsoft PowerPoint 2007 document to text. More...
Public Member Functions | |
filter ($pptx) | |
Extract text contents from a PowerPoint format. |
Filter to convert a Microsoft PowerPoint 2007 document to text.
This implementation uses Zend_Search_Lucene_Docuemtn_Pptx to extract text contents from a PowerPoint document (supports PowerPoint 2007 format only.)
P4Cms_Filter_PptxToText::filter | ( | $ | pptx | ) |
Extract text contents from a PowerPoint format.
string | $pptx | the Powerpoint contents to be filtered. |
{ // shortcut if we have an empty string if (!$pptx) { return; } // write contents to a tmp file $tempFile = tempnam(sys_get_temp_dir(), 'powerpoint'); file_put_contents($tempFile, $pptx); $document = Zend_Search_Lucene_Document_Pptx::loadPptxFile($tempFile); // remove the temp file unlink($tempFile); return $document->getFieldValue('body'); }