public function actionExportWord()
{
//实例化对象
$phpWord = new PhpWord();
//页面设定
$section = $phpWord->addSection(array(
'marginLeft' => 1475,
'marginRight' => 1475,
'marginTop' => 735,
'marginBottom' => 795,
'headerHeight' => 735,
'footerHeight' => 565
));
// Define styles
$paragraphStyleName = 'pStyle';
$phpWord->addParagraphStyle($paragraphStyleName, array('align' => Jc::RIGHT));
// both styles
$bothStyleName = 'pStyleBoth';
$phpWord->addParagraphStyle($bothStyleName, array('align' => Jc::DISTRIBUTE));
$bodyFontStyleName = 'GeneralText';
$phpWord->addFontStyle($bodyFontStyleName, array('name' =
phpword生成word文档
最新推荐文章于 2024-06-29 15:41:56 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)