ciao!
ho installato tramite composer PhpOffice\PhpPresentation.
poi ho creato uno script con il contenuto che ho trovato su github, racchiuso in try/catch:
sulla pagina ottengo questo errore: The file "" doesn't existcodice:require_once 'lib/vendor/autoload.php'; use PhpOffice\PhpPresentation\PhpPresentation; use PhpOffice\PhpPresentation\IOFactory; use PhpOffice\PhpPresentation\Style\Color; use PhpOffice\PhpPresentation\Style\Alignment; try { $objPHPPowerPoint = new PhpPresentation(); $currentSlide = $objPHPPowerPoint->getActiveSlide(); // Create a shape (drawing) $shape = $currentSlide->createDrawingShape(); $shape->setName('PHPPresentation logo') ->setDescription('PHPPresentation logo') // ->setPath('./resources/phppowerpoint_logo.gif') ->setHeight(36) ->setOffsetX(10) ->setOffsetY(10); $shape->getShadow()->setVisible(true) ->setDirection(45) ->setDistance(10); // Create a shape (text) $shape = $currentSlide->createRichTextShape() ->setHeight(300) ->setWidth(600) ->setOffsetX(170) ->setOffsetY(180); $shape->getActiveParagraph()->getAlignment()->setHorizontal(Alignment::HORIZONTAL_CENTER); $textRun = $shape->createTextRun('Thank you for using PHPPresentation!'); $textRun->getFont()->setBold(true) ->setSize(60) ->setColor(new Color('FFE06B20')); $oWriterPPTX = IOFactory::createWriter($objPHPPowerPoint, 'PowerPoint2007'); $oWriterPPTX->save(__DIR__ . "/sample.pptx"); $oWriterODP = IOFactory::createWriter($objPHPPowerPoint, 'ODPresentation'); $oWriterODP->save(__DIR__ . "/sample.odp"); } catch (Exception $ex) { echo $ex->getMessage(); }
qualche idea??

Rispondi quotando