當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。