-
Notifications
You must be signed in to change notification settings - Fork 526
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
#266 : PowerPoint2007 Writer : Fix for Need repair #303
Conversation
I have tested 79c4cff briefly with my own sample file that produces a chart on a slide. This generates a .pptx file that opens successfully in PowerPoint for Mac 2011 14.5.2 and correctly displays a chart. Great. If I open the pptx file in Keynote, there are no warnings but there is no chart on the slide. However, if I save the .pptx file from PowerPoint and open it in Keynote, it appears as expected, with the chart, although there are currently some formatting differences. Running the Sample 05 Chart, if I open the resulting .pptx I get the error "Powerpoint found a problem with content in the Sample_05_Chart.pptx" with the option to Repair. If Repair is selected it says "PowerPoint removed unreadable content..." The charts in the resulting PowerPoint appear correctly but there is a broken image in the top left of each slide saying the image cannot be displayed. The same issue occurs with Sample_01_Simple. However, if I comment out lines 27-39 that Create shape with setPath('./resources/phppowerpoint_logo.gif') the pptx opens with no problem in both PowerPoint and Keynote and displays a slide with "Thank you for using PHPPresentation!" With Sample_05_Chart the resulting pptx opens in Keynote with "An unknown error occurred". The presentation appears with ten slides, each with the PHPPowerpoint logo in the top left [Should that be 'PHP Presentation'?] with a drop shadow, but no charts. This suggests that there is not a problem finding the logo image. If the repaired Sample_05_Chart is saved and then opened in Keynote it produces a warning that "Unsupported media were removed" and "An unknown error occurred". All 10 slides are blank. I appreciate that support for Keynote is not the main objective, but this information may also help troubleshoot issues reported by PowerPoint. |
@informed-source: Thanks for the complete report. Could you send me "the .pptx file saved from PowerPoint" which is good and the file in error ? I need it to analyze what is the difference. Is the image well in the directory "samples / ressources" ? If you are ok 👌 for helping, I will try to improve the support of Keynote. (sorry, I haven't got Keynote) |
Attached are files generated by Sample_05_Chart, as output, after repair in PowerPoint on the Mac, and for comparison after opening in Keynote and saving as pdf and pptx. Sample_05_Chart-as-output.pptx Note that the file 'repaired' by PowerPoint has a broken image on every slide but includes the charts. The source image is present as See also issue: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi there,
I've reviewed the changes using my own written scripts. The "repair" error is gone in PPT2016. Furthermore, the "first" image on the slide now properly works (no "image cannot be displayed" error).
Thanks for the fix!
… (Need repair) Chart Area
@informed-source @jvanoostrom I pushed some code in the PR for fixing the 5th sample. Could you test again, please ? |
Many thanks indeed for this, especially on Christmas Day! I downloaded Tree 146c06d I edited /samples/Sample_Header.php file to point to the correct Autoloader location for this deployment // require_once DIR . '/../vendor/autoload.php'; My own script now runs fine and appears correct in PowerPoint, with charts appearing as expected. Sample_05_Chart.php I understand that this project is intended to support PowerPoint, but Keynote is now very good at opening PowerPoint files and compatibility with the generated files appears to be very close. For reference, these are the results of testing all the sample files: |
@informed-source No problem, I took advantage of the calm of the end of this Christmas day to make benefit PhpPresentation. Thank you for your tests :) Sorry, I don't have Mac and Keynote. Could you shorten the code of the 5th sample to the first slide and try to open it in Keynote ? We work on the 5th sample . And we see after that for two another samples. |
Thanks again for your work on this over the holiday period, which is much appreciated. As requested, in Sample_05_Chart.php I have commented out the function calls for all of the slides apart from the first one, fnSlide_Area($objPHPPresentation). The output pptx file opens as expected in PowerPoint for Mac 2011 (14.5.2) and displays a single slide with an area chart. The pptx file results in the warning "An unknown error occurred" in Keynote and the single slide displays only the gif logo and no chart. When the pptx file is uploaded to the online iCloud Keynote service it imports but also displays only the gif logo and no chart. So the online service could be used for initial testing of Keynote compatibility. If the originated pptx file is opened in PowerPoint but then saved from PowerPoint, it displays correctly in PowerPoint but is still missing the chart when opened in Keynote, either in the OSX application or in the iCloud web view. However, if the area chart is deleted in PowerPoint and recreated as a native PowerPoint/Excel chart and this is saved as a pptx file, it opens and displays as expected in Keynote and iCloud Keynote. This implies that such charts are generally compatible across PowerPoint and Keynote but there may be something about how they are written out by PhpPresentation. This may be an issue not only for Keynote but for general conformance with PowerPoint. Incidentally, the develop branch of PhpExcel is deployed in this case. |
@informed-source Could you create a PPTX with a very simple chart with PowerPoint (which can be opened in Keynote) ? I will try to generate the code for this file, and diff the content of the generated PPTX and your file. |
I have used the single slide version of Sample_05 as the base for this test and attempted to recreate something very similar manually, which opens and displays correctly in both PowerPoint and Keynote. Generated from PhpPresentation Opened in PowerPoint and resaved as pptx Recreated in PowerPoint (deleted chart and added manually with similar properties) This is the file recreated in PowerPoint, opened in Keynote and exported back to PowerPoint. |
Like @jvanoostrom it fixed the same bug for us. |
@informed-source Could you test a thing ? In the file PhpPresentation\Writer\PowerPoint2007\PptCharts.php, could you move the line $this->getZip()->addFromString('ppt/charts/_rels/' . $shape->getIndexedFilename() . '.rels', $this->writeChartRelationships($shape)); before the line : if ($shape->hasIncludedSpreadsheet()) { |
Unfortunately, that appears to break the output, resulting in empty slides. |
@informed-source Shit 💩 ! I don't know where the problem is ! |
:-( |
@informed-source I don't know where the problem can be... Without a Keynote, I can't make tiny tests for finding where the problem is. But I have no idea where Keynote has problems. |
You may be able to open a PowerPoint file with Keynote online. Search for Apple iWork iCloud. It currently works with Safari, Chrome or IE 10+. |
@informed-source https://www.icloud.com/ Account created ;) |
@Progi1984 I am working on a Mac and have Keynote plus old (2008) and new (2016) versions of PowerPoint. Happy to help out with testing. FWIW - I just tried generating a fairly complex file with the current version and it failed to open at all on Keynote and PP08. It repaired and mostly opened on PP16. |
@Progi1984 Actually, ignore my comment about the current version - I may not have been using the correct branch. Will double check this over the weekend and re-do the test. |
@informed-source I have some hints to test... Now, with Keynote on iCloud, I can test if it's ok... :) before asking tests on Keynote on MacOs |
Thanks. Happy to test further on OSX when you have something. |
@informed-source Could you test the Sample 05 Chart with PHPExcel, please, with Keynote, please ? |
Thanks for your work on this. I tested Sample 05 Chart with PHPExcel. In PowerPoint this opens correctly and displays two slides, with a bar chart and a pie chart. This is with and without moving this line in PhpPresentation\Writer\PowerPoint2007\PptCharts.php: |
@informed-source Good news. I have the same render. I think I will create an issue and a MR for working on compatibility with Keynote. That will permit for another user to have PPTX with PowerPoint :) No problem with that ? |
Thanks. Your continued work on this is appreciated. |
No description provided.