2 ini_set('include_path', __DIR__ . '/../../..:.');
3 require_once __DIR__ . '/../Writer.php';
6 $PHPWord = new Document_Word_Writer();
8 // New portrait section
9 $section = $PHPWord->createSection(array('borderColor'=>'00FF00', 'borderSize'=>12));
10 $section->addText('I am placed on a default section.');
12 // New landscape section
13 $section = $PHPWord->createSection(array('orientation'=>'landscape'));
14 $section->addText('I am placed on a landscape section. Every page starting from this section will be landscape style.');
15 $section->addPageBreak();
16 $section->addPageBreak();
18 // New portrait section
19 $section = $PHPWord->createSection(array('marginLeft'=>600, 'marginRight'=>600, 'marginTop'=>600, 'marginBottom'=>600));
20 $section->addText('This section uses other margins.');
25 require_once __DIR__ . '/../Writer/IOFactory.php';
26 $objWriter = Document_Word_Writer_IOFactory::createWriter($PHPWord, 'Word2007');
27 $objWriter->save('/tmp/Section.docx');