1

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:-

enter image description here

Output coming like below:- enter image description here

Can anyone help me how to resolve this issue.

kunal
  • 4,122
  • 12
  • 40
  • 75
  • It looks like a missing image primarily. Perhaps the template links to an external image file and you haven't brought that across when you copied it? Without seeing the pptx file it's hard to know, really. – ADyson Feb 27 '19 at 09:57
  • P.S. I'm not sure the implication of the github issue you linked was that the code presented there was the solution. It was merely part of some analysis. – ADyson Feb 27 '19 at 09:59
  • @ADyson thanks for response. You have any alternative to resolve this issue? – kunal Feb 27 '19 at 10:01
  • well first I suggest you check what I mentioned in the first comment. Secondly make sure you have the latest version of the library which includes the merge which was the result of closing the issue you mentioned. It does note in that discussion that the library is far from perfect. Perhaps it has other issues. – ADyson Feb 27 '19 at 10:03
  • @ADyson i will add images dyanmically but the issue is template styling check the left side bar of the sample.pptx or you know some other library ? – kunal Feb 27 '19 at 10:07
  • i have the latest version of PHPPResentation i have installed using composer – kunal Feb 27 '19 at 10:08

0 Answers0