本文整理汇总了PHP中PhpOffice\PhpPresentation\PhpPresentation::removeSlideByIndex方法的典型用法代码示例。如果您正苦于以下问题:PHP PhpPresentation::removeSlideByIndex方法的具体用法?PHP PhpPresentation::removeSlideByIndex怎么用?PHP PhpPresentation::removeSlideByIndex使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PhpOffice\PhpPresentation\PhpPresentation
的用法示例。
在下文中一共展示了PhpPresentation::removeSlideByIndex方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: loadFile
/**
* Load PhpPresentation Serialized file
*
* @param string $pFilename
* @return \PhpOffice\PhpPresentation\PhpPresentation
*/
protected function loadFile($pFilename)
{
$this->oPhpPresentation = new PhpPresentation();
$this->oPhpPresentation->removeSlideByIndex();
$this->oPhpPresentation->setAllMasterSlides(array());
$this->filename = $pFilename;
$this->oZip = new ZipArchive();
$this->oZip->open($this->filename);
$docPropsCore = $this->oZip->getFromName('docProps/core.xml');
if ($docPropsCore !== false) {
$this->loadDocumentProperties($docPropsCore);
}
$docPropsCustom = $this->oZip->getFromName('docProps/custom.xml');
if ($docPropsCustom !== false) {
$this->loadCustomProperties($docPropsCustom);
}
$pptViewProps = $this->oZip->getFromName('ppt/viewProps.xml');
if ($pptViewProps !== false) {
$this->loadViewProperties($pptViewProps);
}
$pptPresentation = $this->oZip->getFromName('ppt/presentation.xml');
if ($pptPresentation !== false) {
$this->loadDocumentLayout($pptPresentation);
$this->loadSlides($pptPresentation);
}
return $this->oPhpPresentation;
}
示例2: loadFile
/**
* Load PhpPresentation Serialized file
*
* @param string $pFilename
* @return \PhpOffice\PhpPresentation\PhpPresentation
*/
protected function loadFile($pFilename)
{
$this->oPhpPresentation = new PhpPresentation();
$this->oPhpPresentation->removeSlideByIndex();
$this->oZip = new ZipArchive();
$this->oZip->open($pFilename);
$docPropsCore = $this->oZip->getFromName('docProps/core.xml');
if ($docPropsCore !== false) {
$this->loadDocumentProperties($docPropsCore);
}
$pptPresentation = $this->oZip->getFromName('ppt/presentation.xml');
if ($pptPresentation !== false) {
$this->loadSlides($pptPresentation);
}
return $this->oPhpPresentation;
}
示例3: loadFile
/**
* Load PhpPresentation Serialized file
*
* @param string $pFilename
* @return \PhpOffice\PhpPresentation\PhpPresentation
*/
protected function loadFile($pFilename)
{
$this->oPhpPresentation = new PhpPresentation();
$this->oPhpPresentation->removeSlideByIndex();
$this->oZip = new ZipArchive();
$this->oZip->open($pFilename);
$this->oXMLReader = new XMLReader();
if ($this->oXMLReader->getDomFromZip($pFilename, 'meta.xml') !== false) {
$this->loadDocumentProperties();
}
$this->oXMLReader = new XMLReader();
if ($this->oXMLReader->getDomFromZip($pFilename, 'content.xml') !== false) {
$this->loadSlides();
}
return $this->oPhpPresentation;
}
示例4: loadFile
/**
* Load PhpPresentation Serialized file
*
* @param string $pFilename
* @return \PhpOffice\PhpPresentation\PhpPresentation
*/
private function loadFile($pFilename)
{
$this->oPhpPresentation = new PhpPresentation();
$this->oPhpPresentation->removeSlideByIndex();
// Read OLE Blocks
$this->loadOLE($pFilename);
// Read pictures in the Pictures Stream
$this->loadPicturesStream();
// Read information in the Current User Stream
$this->loadCurrentUserStream();
// Read information in the PowerPoint Document Stream
$this->loadPowerpointDocumentStream();
return $this->oPhpPresentation;
}
示例5: date
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';
}
示例6: rebindParent
/**
* Re-bind parent
*
* @param \PhpOffice\PhpPresentation\PhpPresentation $parent
* @return \PhpOffice\PhpPresentation\Slide
*/
public function rebindParent(PhpPresentation $parent)
{
$this->parent->removeSlideByIndex($this->parent->getIndex($this));
$this->parent = $parent;
return $this;
}
示例7: testRemoveSlideByIndexException
/**
* Test remove slide by index exception
*
* @expectedException Exception
* @expectedExceptionMessage Slide index is out of bounds.
*/
public function testRemoveSlideByIndexException()
{
$object = new PhpPresentation();
$object->removeSlideByIndex(1);
}