echo date('H:i:s') . ' Create a shape (rich text) with list with red bullet' . EOL; $shape = $currentSlide->createRichTextShape(); $shape->setHeight(100); $shape->setWidth(400); $shape->setOffsetX(100); $shape->setOffsetY(100); $shape->getActiveParagraph()->getBulletStyle()->setBulletType(Bullet::TYPE_BULLET)->setBulletColor(new Color(Color::COLOR_RED)); $shape->createTextRun('Alpha'); $shape->createParagraph()->createTextRun('Beta'); $shape->createParagraph()->createTextRun('Delta'); $shape->createParagraph()->createTextRun('Epsilon'); } // Create new PHPPresentation object echo date('H:i:s') . ' Create new PHPPresentation object' . EOL; $objPHPPresentation = new PhpPresentation(); // Set properties echo date('H:i:s') . ' Set properties' . EOL; $oProperties = $objPHPPresentation->getDocumentProperties(); $oProperties->setCreator('PHPOffice')->setLastModifiedBy('PHPPresentation Team')->setTitle('Sample 11 Title')->setSubject('Sample 11 Subject')->setDescription('Sample 11 Description')->setKeywords('office 2007 openxml libreoffice odt php')->setCategory('Sample Category'); // Remove first slide echo date('H:i:s') . ' Remove first slide' . EOL; $objPHPPresentation->removeSlideByIndex(0); fnSlideRichText($objPHPPresentation); fnSlideRichTextLineSpacing($objPHPPresentation); fnSlideRichTextShadow($objPHPPresentation); fnSlideRichTextList($objPHPPresentation); // Save file echo write($objPHPPresentation, basename(__FILE__, '.php'), $writers); if (!CLI) { include_once 'Sample_Footer.php'; }
echo date('H:i:s') . ' Create templated slide' . EOL; $currentSlide = createTemplatedSlide($objPHPPowerPoint); // Create a shape (text) echo date('H:i:s') . ' Create a shape (rich text) with shadow' . EOL; $shape = $currentSlide->createRichTextShape(); $shape->setHeight(100); $shape->setWidth(400); $shape->setOffsetX(100); $shape->setOffsetY(100); $shape->getActiveParagraph()->getAlignment()->setHorizontal(Alignment::HORIZONTAL_LEFT); $shape->getShadow()->setVisible(true)->setAlpha(75)->setBlurRadius(2)->setDirection(45); $textRun = $shape->createTextRun('RichText with shadow'); $textRun->getFont()->setColor(new Color('FF000000')); } // Create new PHPPowerPoint object echo date('H:i:s') . ' Create new PHPPowerPoint object' . EOL; $objPHPPowerPoint = new PhpPowerpoint(); // Set properties echo date('H:i:s') . ' Set properties' . EOL; $oProperties = $objPHPPowerPoint->getProperties(); $oProperties->setCreator('PHPOffice')->setLastModifiedBy('PHPPowerPoint Team')->setTitle('Sample 11 Title')->setSubject('Sample 11 Subject')->setDescription('Sample 11 Description')->setKeywords('office 2007 openxml libreoffice odt php')->setCategory('Sample Category'); // Remove first slide echo date('H:i:s') . ' Remove first slide' . EOL; $objPHPPowerPoint->removeSlideByIndex(0); fnSlideRichText($objPHPPowerPoint); fnSlideRichTextShadow($objPHPPowerPoint); // Save file echo write($objPHPPowerPoint, basename(__FILE__, '.php'), $writers); if (!CLI) { include_once 'Sample_Footer.php'; }