require_once 'PHPWord.php';
$PHPWord = new PHPWord();
//默认页面
$section = $PHPWord->createSection(array('borderColor'=>'00FF00','borderSize'=>12));
$section->addText('This is the default section');
//新页面
$section = $PHPWord->createSection(array('orientation'=>'landscape'));
$section->addText('This is placed on a landscape section,Every page starting from this section will be landscape style');
$section->addPageBreak();
$section->addPageBreak();
//New portrait section
$section = $PHPWord->createSection(array('marginLeft'=>600,'marginTop'=>600,'marginBottom'=>600));
$section->addText('This is section users other margins');
//保存文件
$objWriter = PHPWord_IOFactory::createWriter($PHPWord,'Word2007');
$objWriter->save('Section.docx');
【PHPWord】页面Section
最新推荐文章于 2023-06-01 18:08:08 发布