Skip to content

Commit

Permalink
Added .odp writing back
Browse files Browse the repository at this point in the history
.odp writing now works, using a workaround for the following issue:
PHPOffice/PHPPresentation#21

As of now, the presentation gets written to both a .pptx and a .odp
file.
  • Loading branch information
potofcoffee committed May 3, 2014
1 parent bfe77ae commit 8135666
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions build.php
Original file line number Diff line number Diff line change
Expand Up @@ -217,12 +217,22 @@ function getTime($s, $hour=0, $minute=0, $second=0, $base=NULL) {
}


$odpFile = strftime($config['odp']['path'], $startDate);
echo 'Saving Powerpoint presentation file as '.$odpFile.' ... <br />';
$pptFile = strftime($config['ppt']['path'], $startDate);
echo 'Saving Powerpoint presentation file as '.$pptFile.' ... <br />';
$objWriter = PHPPowerPoint_IOFactory::createWriter($ppt, 'PowerPoint2007');
$objWriter->save($odpFile);
$objWriter->save($pptFile);


// set locale to work around bugs: ODPresentation writer needs to be run
// on a locale that uses the dot (.) as decimal mark, otherwise the documents
// will be invalid. This has been filed as issue #21 at
// https://github.com/PHPOffice/PHPPowerPoint/issues/21
setlocale(LC_ALL, 'en_US.utf8');

$odpFile = strftime($config['odp']['path'], $startDate);
echo 'Saving LibreOffice Impress presentation file as '.$odpFile.' ... <br />';
$odpWriter = PHPPowerPoint_IOFactory::createWriter($ppt, 'ODPresentation');
$odpWriter->save($odpFile);


echo '<hr /><a href="index.php">Zurück zum Formular</a>';

0 comments on commit 8135666

Please sign in to comment.