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


PHP PhpPresentation::getZoom方法代码示例

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


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

示例1: writeViewProps

 /**
  * Write ppt/viewProps.xml to XML format
  *
  * @return     string         XML Output
  * @throws     \Exception
  */
 public function writeViewProps(PhpPresentation $oPhpPresentation)
 {
     // Create XML writer
     $objWriter = $this->getXMLWriter();
     // XML header
     $objWriter->startDocument('1.0', 'UTF-8', 'yes');
     // p:viewPr
     $objWriter->startElement('p:viewPr');
     $objWriter->writeAttribute('xmlns:a', 'http://schemas.openxmlformats.org/drawingml/2006/main');
     $objWriter->writeAttribute('xmlns:r', 'http://schemas.openxmlformats.org/officeDocument/2006/relationships');
     $objWriter->writeAttribute('xmlns:p', 'http://schemas.openxmlformats.org/presentationml/2006/main');
     $objWriter->writeAttribute('showComments', '0');
     // p:viewPr > p:slideViewPr
     $objWriter->startElement('p:slideViewPr');
     // p:viewPr > p:slideViewPr > p:cSldViewPr
     $objWriter->startElement('p:cSldViewPr');
     // p:viewPr > p:slideViewPr > p:cSldViewPr > p:cViewPr
     $objWriter->startElement('p:cViewPr');
     // p:viewPr > p:slideViewPr > p:cSldViewPr > p:cViewPr > p:scale
     $objWriter->startElement('p:scale');
     $objWriter->startElement('a:sx');
     $objWriter->writeAttribute('d', '100');
     $objWriter->writeAttribute('n', (int) ($oPhpPresentation->getZoom() * 100));
     $objWriter->endElement();
     $objWriter->startElement('a:sy');
     $objWriter->writeAttribute('d', '100');
     $objWriter->writeAttribute('n', (int) ($oPhpPresentation->getZoom() * 100));
     $objWriter->endElement();
     // > // p:viewPr > p:slideViewPr > p:cSldViewPr > p:cViewPr > p:scale
     $objWriter->endElement();
     $objWriter->startElement('p:origin');
     $objWriter->writeAttribute('x', '0');
     $objWriter->writeAttribute('y', '0');
     $objWriter->endElement();
     // > // p:viewPr > p:slideViewPr > p:cSldViewPr > p:cViewPr
     $objWriter->endElement();
     // > // p:viewPr > p:slideViewPr > p:cSldViewPr
     $objWriter->endElement();
     // > // p:viewPr > p:slideViewPr
     $objWriter->endElement();
     // > // p:viewPr
     $objWriter->endElement();
     return $objWriter->getData();
 }
开发者ID:Progi1984,项目名称:PHPPresentation,代码行数:50,代码来源:PptProps.php

示例2: testZoom

 public function testZoom()
 {
     $object = new PhpPresentation();
     $this->assertEquals(1, $object->getZoom());
     $this->assertInstanceOf('PhpOffice\\PhpPresentation\\PhpPresentation', $object->setZoom('AAAA'));
     $this->assertEquals(1, $object->getZoom());
     $this->assertInstanceOf('PhpOffice\\PhpPresentation\\PhpPresentation', $object->setZoom(2.3));
     $this->assertEquals(2.3, $object->getZoom());
     $this->assertInstanceOf('PhpOffice\\PhpPresentation\\PhpPresentation', $object->setZoom());
     $this->assertEquals(1, $object->getZoom());
 }
开发者ID:Progi1984,项目名称:PHPPresentation,代码行数:11,代码来源:PhpPowerpointTest.php


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