当前位置: 首页>>代码示例>>PHP>>正文


PHP PhpPresentation::getAllMasterSlides方法代码示例

本文整理汇总了PHP中PhpOffice\PhpPresentation\PhpPresentation::getAllMasterSlides方法的典型用法代码示例。如果您正苦于以下问题:PHP PhpPresentation::getAllMasterSlides方法的具体用法?PHP PhpPresentation::getAllMasterSlides怎么用?PHP PhpPresentation::getAllMasterSlides使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PhpOffice\PhpPresentation\PhpPresentation的用法示例。


在下文中一共展示了PhpPresentation::getAllMasterSlides方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: date

use PhpOffice\PhpPresentation\Style\Alignment;
use PhpOffice\PhpPresentation\Style\Color;
use PhpOffice\PhpPresentation\Style\Fill;
// 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;
$objPHPPresentation->getDocumentProperties()->setCreator('PHPOffice')->setLastModifiedBy('PHPPresentation Team')->setTitle('Sample 19 SlideMaster')->setSubject('Sample 19 Subject')->setDescription('Sample 19 Description')->setKeywords('office 2007 openxml libreoffice odt php')->setCategory('Sample Category');
// Create slide
echo date('H:i:s') . ' Create slide' . EOL;
$currentSlide = $objPHPPresentation->getActiveSlide();
// Create a master layout
echo date('H:i:s') . ' Create masterslide layout' . EOL;
// Some decorative lines
$oMasterSlide = $objPHPPresentation->getAllMasterSlides()[0];
$shape = $oMasterSlide->createLineShape(0, 670, 960, 670)->getBorder()->setColor(new Color(Color::COLOR_RED))->setLineWidth(2);
$shape = $oMasterSlide->createLineShape(0, 672, 960, 672)->getBorder()->setColor(new Color(Color::COLOR_WHITE))->setLineWidth(2);
$shape = $oMasterSlide->createLineShape(0, 674, 960, 674)->getBorder()->setColor(new Color(Color::COLOR_DARKBLUE))->setLineWidth(2);
// Title placeholder
$shape = $oMasterSlide->createRichTextShape();
$shape->setWidthAndHeight(960, 80)->setOffsetX(0)->setOffsetY(60);
$shape->getFill()->setFillType(Fill::FILL_SOLID)->setStartColor(new Color(Color::COLOR_BLUE));
$shape->getActiveParagraph()->getAlignment()->setHorizontal(Alignment::HORIZONTAL_RIGHT)->setMarginLeft(200)->setMarginRight(50)->setVertical(Alignment::VERTICAL_CENTER);
$shape->getShadow()->setVisible(true)->setDirection(90)->setDistance(10);
$shape->setAutoFit(RichText::AUTOFIT_NORMAL);
$textRun = $shape->createTextRun('Titel');
$textRun->getFont()->setBold(true)->setSize(30)->setColor(new Color(Color::COLOR_WHITE));
$shape->setPlaceHolder(new Placeholder(Placeholder::PH_TYPE_TITLE));
// Date placeholder
$shape = $oMasterSlide->createRichTextShape();
开发者ID:phpoffice,项目名称:phppowerpoint,代码行数:31,代码来源:Sample_19_SlideMaster.php


注:本文中的PhpOffice\PhpPresentation\PhpPresentation::getAllMasterSlides方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。