/** * Test create new instance */ public function testConstruct() { $object = new PhpPowerpoint(); $slide = $object->getSlide(); $this->assertEquals(new DocumentProperties(), $object->getProperties()); $this->assertEquals(new DocumentLayout(), $object->getLayout()); $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Slide', $object->getSlide()); $this->assertEquals(1, count($object->getAllSlides())); $this->assertEquals(0, $object->getIndex($slide)); $this->assertEquals(1, $object->getSlideCount()); $this->assertEquals(0, $object->getActiveSlideIndex()); $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Slide\\Iterator', $object->getSlideIterator()); }
protected function displayPhpPowerpointInfo(PhpPowerpoint $oPHPPpt) { $this->append('<div class="infoBlk" id="divPhpPowerpointInfo">'); $this->append('<dl>'); $this->append('<dt>Number of slides</dt><dd>' . $oPHPPpt->getSlideCount() . '</dd>'); $this->append('<dt>Document Layout Height</dt><dd>' . $oPHPPpt->getLayout()->getCY(DocumentLayout::UNIT_MILLIMETER) . ' mm</dd>'); $this->append('<dt>Document Layout Width</dt><dd>' . $oPHPPpt->getLayout()->getCX(DocumentLayout::UNIT_MILLIMETER) . ' mm</dd>'); $this->append('<dt>Properties : Category</dt><dd>' . $oPHPPpt->getProperties()->getCategory() . '</dd>'); $this->append('<dt>Properties : Company</dt><dd>' . $oPHPPpt->getProperties()->getCompany() . '</dd>'); $this->append('<dt>Properties : Created</dt><dd>' . $oPHPPpt->getProperties()->getCreated() . '</dd>'); $this->append('<dt>Properties : Creator</dt><dd>' . $oPHPPpt->getProperties()->getCreator() . '</dd>'); $this->append('<dt>Properties : Description</dt><dd>' . $oPHPPpt->getProperties()->getDescription() . '</dd>'); $this->append('<dt>Properties : Keywords</dt><dd>' . $oPHPPpt->getProperties()->getKeywords() . '</dd>'); $this->append('<dt>Properties : Last Modified By</dt><dd>' . $oPHPPpt->getProperties()->getLastModifiedBy() . '</dd>'); $this->append('<dt>Properties : Modified</dt><dd>' . $oPHPPpt->getProperties()->getModified() . '</dd>'); $this->append('<dt>Properties : Subject</dt><dd>' . $oPHPPpt->getProperties()->getSubject() . '</dd>'); $this->append('<dt>Properties : Title</dt><dd>' . $oPHPPpt->getProperties()->getTitle() . '</dd>'); $this->append('</dl>'); $this->append('</div>'); foreach ($oPHPPpt->getAllSlides() as $oSlide) { $this->append('<div class="infoBlk" id="div' . $oSlide->getHashCode() . 'Info">'); $this->append('<dl>'); $this->append('<dt>HashCode</dt><dd>' . $oSlide->getHashCode() . '</dd>'); $this->append('<dt>Slide Layout</dt><dd>' . $oSlide->getSlideLayout() . '</dd>'); $this->append('<dt>Offset X</dt><dd>' . $oSlide->getOffsetX() . '</dd>'); $this->append('<dt>Offset Y</dt><dd>' . $oSlide->getOffsetY() . '</dd>'); $this->append('<dt>Extent X</dt><dd>' . $oSlide->getExtentX() . '</dd>'); $this->append('<dt>Extent Y</dt><dd>' . $oSlide->getExtentY() . '</dd>'); $this->append('</dl>'); $this->append('</div>'); foreach ($oSlide->getShapeCollection() as $oShape) { if ($oShape instanceof Group) { foreach ($oShape->getShapeCollection() as $oShapeChild) { $this->displayShapeInfo($oShapeChild); } } else { $this->displayShapeInfo($oShape); } } } }