PHPPresentation lose styling when we copy from particular path and saving new pptx

亡梦爱人 提交于 2020-01-05 10:08:13

问题


I have search around google regarding PHPPresentation but nothing found. I know this type of question already asked (PHPOffice PHPPresentation lose original styling on saving pptx) and i have checked the answer of this particular question (https://github.com/PHPOffice/PHPPresentation/issues/161)

I have done according to above answer but its not working at all. Here is my below code:-

$templatepath = public_path('images/samples/sample.pptx');
$pptReader = IOFactory::createReader('PowerPoint2007');
$oPHPPresentation = $pptReader->load("$templatepath");
//save pptx
$xmlWriter = IOFactory::createWriter($oPHPPresentation, 'PowerPoint2007');
$newsamplepath = storage_path('app/public/ppts/sample'.str_random(5).'.pptx');
$xmlWriter->save($newsamplepath);

My sample.pptx looks like below:-

Output coming like below:-

Can anyone help me how to resolve this issue.

来源:https://stackoverflow.com/questions/54902336/phppresentation-lose-styling-when-we-copy-from-particular-path-and-saving-new-pp

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!