setLayout() public method

Set layout
public setLayout ( DocumentLayout $value ) : PhpPresentation
$value DocumentLayout
return PhpPresentation
Example #1
0
 public function testCustomDocumentLayout()
 {
     $oPhpPresentation = new PhpPresentation();
     $oDocumentLayout = new DocumentLayout();
     $oDocumentLayout->setDocumentLayout(array('cx' => rand(1, 100), 'cy' => rand(1, 100)));
     $oPhpPresentation->setLayout($oDocumentLayout);
     $pres = TestHelperDOCX::getDocument($oPhpPresentation, 'ODPresentation');
     $element = "/office:document-styles/office:automatic-styles/style:page-layout";
     $this->assertTrue($pres->elementExists($element, 'styles.xml'));
     $this->assertEquals('sPL0', $pres->getElementAttribute($element, 'style:name', 'styles.xml'));
     $element = "/office:document-styles/office:master-styles/style:master-page";
     $this->assertTrue($pres->elementExists($element, 'styles.xml'));
     $this->assertEquals('sPL0', $pres->getElementAttribute($element, 'style:page-layout-name', 'styles.xml'));
 }