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


PHP PhpPresentation::getAllSlides方法代码示例

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


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

示例1: testConstruct

 /**
  * Test create new instance
  */
 public function testConstruct()
 {
     $object = new PhpPresentation();
     $slide = $object->getSlide();
     $this->assertEquals(new DocumentProperties(), $object->getDocumentProperties());
     $this->assertEquals(new DocumentLayout(), $object->getLayout());
     $this->assertInstanceOf('PhpOffice\\PhpPresentation\\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\\PhpPresentation\\Slide\\Iterator', $object->getSlideIterator());
 }
开发者ID:phpoffice,项目名称:phppowerpoint,代码行数:16,代码来源:PhpPresentationTest.php

示例2: displayPhpPresentationInfo

 protected function displayPhpPresentationInfo(PhpPresentation $oPHPPpt)
 {
     $this->append('<div class="infoBlk" id="divPhpPresentationInfo">');
     $this->append('<dl>');
     $this->append('<dt>Number of slides</dt><dd>' . $oPHPPpt->getSlideCount() . '</dd>');
     $this->append('<dt>Document Layout Name</dt><dd>' . (empty($oPHPPpt->getLayout()->getDocumentLayout()) ? 'Custom' : $oPHPPpt->getLayout()->getDocumentLayout()) . '</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->getDocumentProperties()->getCategory() . '</dd>');
     $this->append('<dt>Properties : Company</dt><dd>' . $oPHPPpt->getDocumentProperties()->getCompany() . '</dd>');
     $this->append('<dt>Properties : Created</dt><dd>' . $oPHPPpt->getDocumentProperties()->getCreated() . '</dd>');
     $this->append('<dt>Properties : Creator</dt><dd>' . $oPHPPpt->getDocumentProperties()->getCreator() . '</dd>');
     $this->append('<dt>Properties : Description</dt><dd>' . $oPHPPpt->getDocumentProperties()->getDescription() . '</dd>');
     $this->append('<dt>Properties : Keywords</dt><dd>' . $oPHPPpt->getDocumentProperties()->getKeywords() . '</dd>');
     $this->append('<dt>Properties : Last Modified By</dt><dd>' . $oPHPPpt->getDocumentProperties()->getLastModifiedBy() . '</dd>');
     $this->append('<dt>Properties : Modified</dt><dd>' . $oPHPPpt->getDocumentProperties()->getModified() . '</dd>');
     $this->append('<dt>Properties : Subject</dt><dd>' . $oPHPPpt->getDocumentProperties()->getSubject() . '</dd>');
     $this->append('<dt>Properties : Title</dt><dd>' . $oPHPPpt->getDocumentProperties()->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>Layout::' . $this->getConstantName('\\PhpOffice\\PhpPresentation\\Slide\\Layout', $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>');
         $oBkg = $oSlide->getBackground();
         if ($oBkg instanceof Slide\AbstractBackground) {
             if ($oBkg instanceof Slide\Background\Color) {
                 $this->append('<dt>Background Color</dt><dd>#' . $oBkg->getColor()->getRGB() . '</dd>');
             }
             if ($oBkg instanceof Slide\Background\Image) {
                 $sBkgImgContents = file_get_contents($oBkg->getPath());
                 $this->append('<dt>Background Image</dt><dd><img src="data:image/png;base64,' . base64_encode($sBkgImgContents) . '"></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);
             }
         }
     }
 }
开发者ID:phpoffice,项目名称:phppowerpoint,代码行数:52,代码来源:Sample_Header.php

示例3: save


//.........这里部分代码省略.........
         if (!$writerPartMeta instanceof Meta) {
             throw new \Exception('The $parentWriter is not an instance of \\PhpOffice\\PhpPresentation\\Writer\\ODPresentation\\Meta');
         }
         $writerPartMimetype = $this->getWriterPart('mimetype');
         if (!$writerPartMimetype instanceof Mimetype) {
             throw new \Exception('The $parentWriter is not an instance of \\PhpOffice\\PhpPresentation\\Writer\\ODPresentation\\Mimetype');
         }
         $writerPartStyles = $this->getWriterPart('styles');
         if (!$writerPartStyles instanceof Styles) {
             throw new \Exception('The $parentWriter is not an instance of \\PhpOffice\\PhpPresentation\\Writer\\ODPresentation\\Styles');
         }
         // Create drawing dictionary
         $this->drawingHashTable->addFromSource($writerPartDrawing->allDrawings($this->presentation));
         // Create new ZIP file and open it for writing
         $objZip = new \ZipArchive();
         // Try opening the ZIP file
         if ($objZip->open($pFilename, \ZIPARCHIVE::OVERWRITE) !== true) {
             if ($objZip->open($pFilename, \ZIPARCHIVE::CREATE) !== true) {
                 throw new \Exception("Could not open " . $pFilename . " for writing.");
             }
         }
         // Add mimetype to ZIP file
         //@todo Not in ZIPARCHIVE::CM_STORE mode
         $objZip->addFromString('mimetype', $writerPartMimetype->writePart());
         // Add content.xml to ZIP file
         $objZip->addFromString('content.xml', $writerPartContent->writePart($this->presentation));
         // Add meta.xml to ZIP file
         $objZip->addFromString('meta.xml', $writerPartMeta->writePart($this->presentation));
         // Add styles.xml to ZIP file
         $objZip->addFromString('styles.xml', $writerPartStyles->writePart($this->presentation));
         // Add META-INF/manifest.xml
         $objZip->addFromString('META-INF/manifest.xml', $writerPartManifest->writePart());
         // Add charts
         foreach ($this->chartArray as $keyChart => $shapeChart) {
             $arrayFile = $writerPartChart->writePart($shapeChart);
             foreach ($arrayFile as $file => $content) {
                 if (!empty($content)) {
                     $objZip->addFromString('Object ' . $keyChart . '/' . $file, $content);
                 }
             }
         }
         // Add media
         $arrMedia = array();
         for ($i = 0; $i < $this->getDrawingHashTable()->count(); ++$i) {
             $shape = $this->getDrawingHashTable()->getByIndex($i);
             if (!$shape instanceof AbstractDrawing) {
                 throw new \Exception('The $parentWriter is not an instance of \\PhpOffice\\PhpPresentation\\Shape\\AbstractDrawing');
             }
             if ($shape instanceof ShapeDrawing) {
                 if (!in_array(md5($shape->getPath()), $arrMedia)) {
                     $arrMedia[] = md5($shape->getPath());
                     $imagePath = $shape->getPath();
                     if (strpos($imagePath, 'zip://') !== false) {
                         $imagePath = substr($imagePath, 6);
                         $imagePathSplitted = explode('#', $imagePath);
                         $imageZip = new \ZipArchive();
                         $imageZip->open($imagePathSplitted[0]);
                         $imageContents = $imageZip->getFromName($imagePathSplitted[1]);
                         $imageZip->close();
                         unset($imageZip);
                     } else {
                         $imageContents = file_get_contents($imagePath);
                     }
                     $objZip->addFromString('Pictures/' . md5($shape->getPath()) . '.' . $shape->getExtension(), $imageContents);
                 }
             } elseif ($shape instanceof MemoryDrawing) {
                 if (!in_array(str_replace(' ', '_', $shape->getIndexedFilename()), $arrMedia)) {
                     $arrMedia[] = str_replace(' ', '_', $shape->getIndexedFilename());
                     ob_start();
                     call_user_func($shape->getRenderingFunction(), $shape->getImageResource());
                     $imageContents = ob_get_contents();
                     ob_end_clean();
                     $objZip->addFromString('Pictures/' . str_replace(' ', '_', $shape->getIndexedFilename()), $imageContents);
                 }
             }
         }
         foreach ($this->presentation->getAllSlides() as $keySlide => $oSlide) {
             // Add background image slide
             $oBkgImage = $oSlide->getBackground();
             if ($oBkgImage instanceof Image) {
                 $objZip->addFromString('Pictures/' . $oBkgImage->getIndexedFilename($keySlide), file_get_contents($oBkgImage->getPath()));
             }
         }
         // Close file
         if ($objZip->close() === false) {
             throw new \Exception("Could not close zip file {$pFilename}.");
         }
         // If a temporary file was used, copy it to the correct file stream
         if ($originalFilename != $pFilename) {
             if (copy($pFilename, $originalFilename) === false) {
                 throw new \Exception("Could not copy temporary zip file {$pFilename} to {$originalFilename}.");
             }
             if (@unlink($pFilename) === false) {
                 throw new \Exception('The file ' . $pFilename . ' could not be deleted.');
             }
         }
     } else {
         throw new \Exception("PhpPresentation object unassigned.");
     }
 }
开发者ID:Progi1984,项目名称:PHPPresentation,代码行数:101,代码来源:ODPresentation.php

示例4: writePart

 /**
  * Write content file to XML format
  *
  * @param  PhpPresentation $pPhpPresentation
  * @return string        XML Output
  * @throws \Exception
  */
 public function writePart(PhpPresentation $pPhpPresentation)
 {
     // Create XML writer
     $objWriter = $this->getXMLWriter();
     // XML header
     $objWriter->startDocument('1.0', 'UTF-8');
     // office:document-content
     $objWriter->startElement('office:document-content');
     $objWriter->writeAttribute('xmlns:office', 'urn:oasis:names:tc:opendocument:xmlns:office:1.0');
     $objWriter->writeAttribute('xmlns:style', 'urn:oasis:names:tc:opendocument:xmlns:style:1.0');
     $objWriter->writeAttribute('xmlns:text', 'urn:oasis:names:tc:opendocument:xmlns:text:1.0');
     $objWriter->writeAttribute('xmlns:table', 'urn:oasis:names:tc:opendocument:xmlns:table:1.0');
     $objWriter->writeAttribute('xmlns:draw', 'urn:oasis:names:tc:opendocument:xmlns:drawing:1.0');
     $objWriter->writeAttribute('xmlns:fo', 'urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0');
     $objWriter->writeAttribute('xmlns:xlink', 'http://www.w3.org/1999/xlink');
     $objWriter->writeAttribute('xmlns:dc', 'http://purl.org/dc/elements/1.1/');
     $objWriter->writeAttribute('xmlns:meta', 'urn:oasis:names:tc:opendocument:xmlns:meta:1.0');
     $objWriter->writeAttribute('xmlns:number', 'urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0');
     $objWriter->writeAttribute('xmlns:presentation', 'urn:oasis:names:tc:opendocument:xmlns:presentation:1.0');
     $objWriter->writeAttribute('xmlns:svg', 'urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0');
     $objWriter->writeAttribute('xmlns:chart', 'urn:oasis:names:tc:opendocument:xmlns:chart:1.0');
     $objWriter->writeAttribute('xmlns:dr3d', 'urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0');
     $objWriter->writeAttribute('xmlns:math', 'http://www.w3.org/1998/Math/MathML');
     $objWriter->writeAttribute('xmlns:form', 'urn:oasis:names:tc:opendocument:xmlns:form:1.0');
     $objWriter->writeAttribute('xmlns:script', 'urn:oasis:names:tc:opendocument:xmlns:script:1.0');
     $objWriter->writeAttribute('xmlns:ooo', 'http://openoffice.org/2004/office');
     $objWriter->writeAttribute('xmlns:ooow', 'http://openoffice.org/2004/writer');
     $objWriter->writeAttribute('xmlns:oooc', 'http://openoffice.org/2004/calc');
     $objWriter->writeAttribute('xmlns:dom', 'http://www.w3.org/2001/xml-events');
     $objWriter->writeAttribute('xmlns:xforms', 'http://www.w3.org/2002/xforms');
     $objWriter->writeAttribute('xmlns:xsd', 'http://www.w3.org/2001/XMLSchema');
     $objWriter->writeAttribute('xmlns:xsi', 'http://www.w3.org/2001/XMLSchema-instance');
     $objWriter->writeAttribute('xmlns:smil', 'urn:oasis:names:tc:opendocument:xmlns:smil-compatible:1.0');
     $objWriter->writeAttribute('xmlns:anim', 'urn:oasis:names:tc:opendocument:xmlns:animation:1.0');
     $objWriter->writeAttribute('xmlns:rpt', 'http://openoffice.org/2005/report');
     $objWriter->writeAttribute('xmlns:of', 'urn:oasis:names:tc:opendocument:xmlns:of:1.2');
     $objWriter->writeAttribute('xmlns:rdfa', 'http://docs.oasis-open.org/opendocument/meta/rdfa#');
     $objWriter->writeAttribute('xmlns:field', 'urn:openoffice:names:experimental:ooo-ms-interop:xmlns:field:1.0');
     $objWriter->writeAttribute('office:version', '1.2');
     // office:automatic-styles
     $objWriter->startElement('office:automatic-styles');
     $this->shapeId = 0;
     $incSlide = 0;
     foreach ($pPhpPresentation->getAllSlides() as $pSlide) {
         // Slides
         $this->writeStyleSlide($objWriter, $pSlide, $incSlide);
         // Images
         $shapes = $pSlide->getShapeCollection();
         foreach ($shapes as $shape) {
             // Increment $this->shapeId
             ++$this->shapeId;
             // Check type
             if ($shape instanceof RichText) {
                 $this->writeTxtStyle($objWriter, $shape);
             }
             if ($shape instanceof AbstractDrawing) {
                 $this->writeDrawingStyle($objWriter, $shape);
             }
             if ($shape instanceof Line) {
                 $this->writeLineStyle($objWriter, $shape);
             }
             if ($shape instanceof Table) {
                 $this->writeTableStyle($objWriter, $shape);
             }
             if ($shape instanceof Group) {
                 $this->writeGroupStyle($objWriter, $shape);
             }
         }
         $incSlide++;
     }
     // Style : Bullet
     if (!empty($this->arrStyleBullet)) {
         foreach ($this->arrStyleBullet as $key => $item) {
             $oStyle = $item['oStyle'];
             $arrLevel = explode(';', $item['level']);
             // style:style
             $objWriter->startElement('text:list-style');
             $objWriter->writeAttribute('style:name', 'L_' . $key);
             foreach ($arrLevel as $level) {
                 if ($level != '') {
                     $oAlign = $item['oAlign_' . $level];
                     // text:list-level-style-bullet
                     $objWriter->startElement('text:list-level-style-bullet');
                     $objWriter->writeAttribute('text:level', $level + 1);
                     $objWriter->writeAttribute('text:bullet-char', $oStyle->getBulletChar());
                     // style:list-level-properties
                     $objWriter->startElement('style:list-level-properties');
                     if ($oAlign->getIndent() < 0) {
                         $objWriter->writeAttribute('text:space-before', CommonDrawing::pixelsToCentimeters($oAlign->getMarginLeft() - -1 * $oAlign->getIndent()) . 'cm');
                         $objWriter->writeAttribute('text:min-label-width', CommonDrawing::pixelsToCentimeters(-1 * $oAlign->getIndent()) . 'cm');
                     } else {
                         $objWriter->writeAttribute('text:space-before', CommonDrawing::pixelsToCentimeters($oAlign->getMarginLeft() - $oAlign->getIndent()) . 'cm');
                         $objWriter->writeAttribute('text:min-label-width', CommonDrawing::pixelsToCentimeters($oAlign->getIndent()) . 'cm');
//.........这里部分代码省略.........
开发者ID:Progi1984,项目名称:PHPPresentation,代码行数:101,代码来源:Content.php

示例5: writePart

 /**
  * Write Meta file to XML format
  *
  * @param  PhpPresentation $pPhpPresentation
  * @return string        XML Output
  * @throws \Exception
  */
 public function writePart(PhpPresentation $pPhpPresentation)
 {
     // Create XML writer
     $objWriter = $this->getXMLWriter();
     // XML header
     $objWriter->startDocument('1.0', 'UTF-8');
     // office:document-meta
     $objWriter->startElement('office:document-styles');
     $objWriter->writeAttribute('xmlns:office', 'urn:oasis:names:tc:opendocument:xmlns:office:1.0');
     $objWriter->writeAttribute('xmlns:style', 'urn:oasis:names:tc:opendocument:xmlns:style:1.0');
     $objWriter->writeAttribute('xmlns:text', 'urn:oasis:names:tc:opendocument:xmlns:text:1.0');
     $objWriter->writeAttribute('xmlns:table', 'urn:oasis:names:tc:opendocument:xmlns:table:1.0');
     $objWriter->writeAttribute('xmlns:draw', 'urn:oasis:names:tc:opendocument:xmlns:drawing:1.0');
     $objWriter->writeAttribute('xmlns:fo', 'urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0');
     $objWriter->writeAttribute('xmlns:xlink', 'http://www.w3.org/1999/xlink');
     $objWriter->writeAttribute('xmlns:dc', 'http://purl.org/dc/elements/1.1/');
     $objWriter->writeAttribute('xmlns:meta', 'urn:oasis:names:tc:opendocument:xmlns:meta:1.0');
     $objWriter->writeAttribute('xmlns:number', 'urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0');
     $objWriter->writeAttribute('xmlns:presentation', 'urn:oasis:names:tc:opendocument:xmlns:presentation:1.0');
     $objWriter->writeAttribute('xmlns:svg', 'urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0');
     $objWriter->writeAttribute('xmlns:chart', 'urn:oasis:names:tc:opendocument:xmlns:chart:1.0');
     $objWriter->writeAttribute('xmlns:dr3d', 'urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0');
     $objWriter->writeAttribute('xmlns:math', 'http://www.w3.org/1998/Math/MathML');
     $objWriter->writeAttribute('xmlns:form', 'urn:oasis:names:tc:opendocument:xmlns:form:1.0');
     $objWriter->writeAttribute('xmlns:script', 'urn:oasis:names:tc:opendocument:xmlns:script:1.0');
     $objWriter->writeAttribute('xmlns:ooo', 'http://openoffice.org/2004/office');
     $objWriter->writeAttribute('xmlns:ooow', 'http://openoffice.org/2004/writer');
     $objWriter->writeAttribute('xmlns:oooc', 'http://openoffice.org/2004/calc');
     $objWriter->writeAttribute('xmlns:dom', 'http://www.w3.org/2001/xml-events');
     $objWriter->writeAttribute('xmlns:smil', 'urn:oasis:names:tc:opendocument:xmlns:smil-compatible:1.0');
     $objWriter->writeAttribute('xmlns:anim', 'urn:oasis:names:tc:opendocument:xmlns:animation:1.0');
     $objWriter->writeAttribute('xmlns:rpt', 'http://openoffice.org/2005/report');
     $objWriter->writeAttribute('xmlns:of', 'urn:oasis:names:tc:opendocument:xmlns:of:1.2');
     $objWriter->writeAttribute('xmlns:xhtml', 'http://www.w3.org/1999/xhtml');
     $objWriter->writeAttribute('xmlns:grddl', 'http://www.w3.org/2003/g/data-view#');
     $objWriter->writeAttribute('xmlns:officeooo', 'http://openoffice.org/2009/office');
     $objWriter->writeAttribute('xmlns:tableooo', 'http://openoffice.org/2009/table');
     $objWriter->writeAttribute('xmlns:drawooo', 'http://openoffice.org/2010/draw');
     $objWriter->writeAttribute('xmlns:css3t', 'http://www.w3.org/TR/css3-text/');
     $objWriter->writeAttribute('office:version', '1.2');
     // Variables
     $stylePageLayout = $pPhpPresentation->getLayout()->getDocumentLayout();
     // office:styles
     $objWriter->startElement('office:styles');
     // style:style
     $objWriter->startElement('style:style');
     $objWriter->writeAttribute('style:name', 'sPres0');
     $objWriter->writeAttribute('style:display-name', 'sPres0');
     $objWriter->writeAttribute('style:family', 'presentation');
     // style:graphic-properties
     $objWriter->startElement('style:graphic-properties');
     $objWriter->writeAttribute('draw:fill-color', '#ffffff');
     // > style:graphic-properties
     $objWriter->endElement();
     // > style:style
     $objWriter->endElement();
     foreach ($pPhpPresentation->getAllSlides() as $slide) {
         foreach ($slide->getShapeCollection() as $shape) {
             if ($shape instanceof Table) {
                 $this->writeTableStyle($objWriter, $shape);
             } elseif ($shape instanceof Group) {
                 $this->writeGroupStyle($objWriter, $shape);
             } elseif ($shape instanceof RichText) {
                 $this->writeRichTextStyle($objWriter, $shape);
             }
         }
     }
     // > office:styles
     $objWriter->endElement();
     // office:automatic-styles
     $objWriter->startElement('office:automatic-styles');
     // style:page-layout
     $objWriter->startElement('style:page-layout');
     if (empty($stylePageLayout)) {
         $objWriter->writeAttribute('style:name', 'sPL0');
     } else {
         $objWriter->writeAttribute('style:name', $stylePageLayout);
     }
     // style:page-layout-properties
     $objWriter->startElement('style:page-layout-properties');
     $objWriter->writeAttribute('fo:margin-top', '0cm');
     $objWriter->writeAttribute('fo:margin-bottom', '0cm');
     $objWriter->writeAttribute('fo:margin-left', '0cm');
     $objWriter->writeAttribute('fo:margin-right', '0cm');
     $objWriter->writeAttribute('fo:page-width', Text::numberFormat(CommonDrawing::pixelsToCentimeters(CommonDrawing::emuToPixels($pPhpPresentation->getLayout()->getCX())), 1) . 'cm');
     $objWriter->writeAttribute('fo:page-height', Text::numberFormat(CommonDrawing::pixelsToCentimeters(CommonDrawing::emuToPixels($pPhpPresentation->getLayout()->getCY())), 1) . 'cm');
     if ($pPhpPresentation->getLayout()->getCX() > $pPhpPresentation->getLayout()->getCY()) {
         $objWriter->writeAttribute('style:print-orientation', 'landscape');
     } else {
         $objWriter->writeAttribute('style:print-orientation', 'portrait');
     }
     $objWriter->endElement();
     $objWriter->endElement();
//.........这里部分代码省略.........
开发者ID:hxsam,项目名称:PHPPresentation,代码行数:101,代码来源:Styles.php

示例6: displayPhpPresentationInfo

 protected function displayPhpPresentationInfo(PhpPresentation $oPHPPpt)
 {
     $this->append('<div class="infoBlk" id="divPhpPresentationInfo">');
     $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>Layout::' . $this->getConstantName('\\PhpOffice\\PhpPresentation\\Slide\\Layout', $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);
             }
         }
     }
 }
开发者ID:hxsam,项目名称:PHPPresentation,代码行数:41,代码来源:Sample_Header.php


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