Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

$oPHPPresentation->createSlide() causing corrupted file #282

Closed
kimubach opened this issue Oct 14, 2016 · 3 comments
Closed

$oPHPPresentation->createSlide() causing corrupted file #282

kimubach opened this issue Oct 14, 2016 · 3 comments
Milestone

Comments

@kimubach
Copy link

kimubach commented Oct 14, 2016

Hello,

I'm reading a pptx file and adding some slides but it allways gets corrupted and powerpoint asks to repair it and it gets repaired successfully.

Even adding a blank slide it shows the error

I attach the corrupted file generated by PHPPresentation and the same file repaired by PowerPoint

What can i do to fix that?

Thanks a lot!

pptfileREPAIRED.pptx
pptfileERROR.pptx

@kimubach
Copy link
Author

kimubach commented Oct 17, 2016

Solved!

Answer found at slackoverflow:
http://stackoverflow.com/questions/39964949/phppresentation-file-with-2-slides-requires-repair

Copy the layout.

$objPHPPresentation = new PhpPresentation();
$oMasterSlide = $objPHPPresentation->getAllMasterSlides()[0];
$oSlideLayout = $oMasterSlide->getAllSlideLayouts()[0];

Then copy the layout to each new slide:

$currentSlide->setSlideLayout($oSlideLayout);

@Progi1984
Copy link
Member

@kimubach Could you test this PR #303 ? Please and thanks for advance

@Progi1984
Copy link
Member

@kimubach The PR #303 has been merged in develop branch. Thanks.

@Progi1984 Progi1984 added this to the 0.8.0 milestone Jan 9, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants