require_once 'PHPWord.php';
$PHPWord = new PHPWord();
$section = $PHPWord->createSection();
//添加图片
$section->addImage('_mars.jpg');
$section->addTextBreak(2);
$section->addImage('_earth.jpg',array('width'=>210,'height'=>210,'align'=>'center'));
$section->addTextBreak(2);
$section->addImage('_mars.jpg',array('width'=>100,'height'=>100,'align'=>'right'));
//保存文件
$objWriter = PHPWord_IOFactory::createWriter($PHPWord,'Word2007');
$objWriter->save('Imaege.docx');
【PHPWord】图片
最新推荐文章于 2024-01-24 15:19:03 发布