require_once 'PHPWord.php';
$PHPWord = new PHPWord();
$section = $PHPWord->createSection();
//创建页眉
$header = $section->createHeader();
//添加水印到页眉
$header->addWatermark('_earth.jpg',array('height'=>30,'width'=>100,'marginTop'=>30,'marginLeft'=>455));
$section->addText('The header reference to the current section includes a watermark image');
//保存文件
$objWriter = PHPWord_IOFactory::createWriter($PHPWord,'Word2007');
$objWriter->save('WaterMark.docx');
【PHPWord】页面添加图片水印
最新推荐文章于 2024-05-19 16:13:18 发布