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

v0.7.0 unable to open generated PPT #276

Closed
gurnzbot opened this issue Sep 26, 2016 · 10 comments
Closed

v0.7.0 unable to open generated PPT #276

gurnzbot opened this issue Sep 26, 2016 · 10 comments

Comments

@gurnzbot
Copy link

gurnzbot commented Sep 26, 2016

Using v0.7.0, I am able to generate a PPT file. When I attempt to open the resulting file, I am unable to open it.

I've tried to do the bare minimum when generating the presentation file.

My PHP code:

$filename = "presentation.pptx";

$objPHPPresentation = new PhpPresentation();
$currentSlide = $objPHPPresentation->getActiveSlide();
$objWriter = IOFactory::createWriter($objPHPPresentation, 'PowerPoint2007');
$objWriter->save($base_url.$filename);

I rolled back to v0.6.0 and was able to open the file generated using the same script.
If I can help at all please let me know :)

@informed-source
Copy link

We have experienced similar issues, with PowerPoint on the Mac, using v0.7.

@jamesggordon
Copy link
Contributor

I am also experiencing issues with two versions of PowerPoint on the Mac - 2008 and 2016.

I can also tell you the exact commit where things stopped working. On April 1 there were a series of commits. If I check out the second last commit from April 1 (ee07eb7) then the PowerPoint files I generate open fine on both versions of PowerPoint. However, if I check out the very next commit (f33d8f3), PowerPoint 2008 fails to open the file at all and PowerPoint 2016 complains about corruption and offers to repair the file, warning that some content may be lost.

I haven't had time to go through the code in that commit, as there were quite a few files changed, but I definitely think this would be a good place to start looking for problems.

@Progi1984
Copy link
Member

@gurnzbot @informed-source @jamesggordon : Could you test the last version of the develop branch ? @jrking4 has fixed its version for PowerPoint for Mac

@informed-source
Copy link

Will do.

On 16 Nov 2016, at 12:42, Progi1984 [email protected] wrote:

@gurnzbot https://github.com/gurnzbot @informed-source https://github.com/informed-source @jamesggordon https://github.com/jamesggordon : Could you test the last version of the develop branch ? @jrking4 https://github.com/jrking4 has fixed its version for PowerPoint for Mac


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub #276 (comment), or mute the thread https://github.com/notifications/unsubscribe-auth/AUVeI6m3twGKYgplcwZK86TvEdszCXibks5q-voYgaJpZM4KGqiz.

@jamesggordon
Copy link
Contributor

jamesggordon commented Nov 17, 2016

I am still receiving the error: PowerPoint found a problem with content in the file xyz.pptx. PowerPoint can attempt to repair the file. If you trust the source of this file, click "Repair".

My file is quite complicated and uses a lot of in-memory drawing objects and other features. What I will do is strip it back step-by-step until I can generate a clean file and then I'll be able to identify which feature is causing problems. This could take a few hours, though, so probably won't be able to do it until the weekend. Stay tuned...

PS My version of PowerPoint for Mac just updated this morning, so I'm on version 15.28 (161115).

@jamesggordon
Copy link
Contributor

There seems to be a problem rendering images using the createDrawingShape() method.

As a simple test, I ran Sample_01_Simple.php from the samples folder and when I opened the generated file I got the error (I'm running the latest version of PowerPoint for Mac - 15.28). I opened the same file on PowerPoint 2007 SP3 on Windows and still got the error.

But when I commented out lines 29 to 39 in Sample_01_Simple.php the error went away on both platforms.

@informed-source
Copy link

I also get a PowerPoint error. I am still using PowerPoint for Mac 2011 14.5.2.
With Sample_01_Simple.php, opening the resulting .pptx file causes a PowerPoint error:
PowerPoint found a problem with the content in the file Sample_01_Simple.pptx.
PowerPoint can attempt to repair the file. If you trust the source of the file, click Repair.
Clicking Cancel produces the PowerPoint error:
PowerPoint cannot open the file … The file may be damaged, or it may have been created with a pre-release version of PowerPoint.
Repairing the file produces the alert:
Powerpoint removed unreadable content in the file Sample_01_Simple.pptx.
Opening the repaired file shows a broken image in the top left of the slide.
However, the file opens correctly in Keynote, with a hyperlinked PHPPowerPoint (sic) logo in the top left corner of the slide.
Commenting out lines 29 to 39 in Sample_01_Simple.php as suggested by James and opening the resulting .pptx file does not result in a PowerPoint error and the presentation opens as expected.
It also opens correctly in Keynote.

I get a similar PowerPoint error with other sample files, such as Sample_05_Chart.php.
Repairing the file leaves the first slide blank and a broken image placeholder on each of the following slides, although the charts appear as expected.
However, taking the .pptx file as generated and opening in Keynote produces a Warnings dialogue: An unknown error occurred.
The PHPPowerPoint (sic) logo is present on every slide, but there are no charts.

The latest dev version still breaks my own slide creation script, resulting in the same PowerPoint error.
Repairing the file removes the chart that I am attempting to create.
The previous version of PHPPresentation outputs the PowerPoint as expected, including the chart.
However, opening the generated .pptx file in Keynote opens without warnings, but with the chart omitted.

@informed-source
Copy link

I might add that with my own script, with the working version of PHPPresentation, opening the generated file in PowerPoint and then saving it from PowerPoint allows it to be opened in Keynote, with the chart intact. This suggests there is something different with the structure or syntax of the file generated by PHPPresentation.

@Progi1984
Copy link
Member

@informed-source Could you test this PR #303 ? Please and thanks for advance

@Progi1984
Copy link
Member

@informed-source @jamesggordon @gurnzbot The PR #303 has been merged in develop branch. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

4 participants