本文整理匯總了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();
}
示例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());
}