-
Notifications
You must be signed in to change notification settings - Fork 529
Make a PPTX compatible with Mac Keynote #46
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
Comments
Here are two PPT files created from latest Mac Keynote. One is .ppt and other is .pptx Thank you for your help and this terrific library. https://www.dropbox.com/s/2msgluuwnp9cn2d/two-ppts-from-keynote.zip |
@surefirejack Could you test with the lastest version of the develop branch, plz ? Poke @Djuki |
Unfortunately I'm still getting an error that it can't be opened. I pulled from the latest dev branch and manually inspected my code to make sure that your update was included, and it was. |
@surefirejack I had an epiphany last night : I haven't done declarations in ContentTypes file. Could you test again, plz ? I will not give. |
I tried after doing composer update and it doesn't work. Plus I tried opening with Open Office (which has always worked for PPT files created with your library) and got this error: http://screencast.com/t/aWDNqFH2wwwh Here's the code my developer created to test out the file: https://gist.github.com/surefirejack/a1e7403bf174bb6e507a |
@surefirejack Could you try this :
Thanks :) PS : Personnally, I tested with Libreoffice 4.2.5.2 Windows and no problem |
Errors : |
I'm assuming you mean these lines:
I tried the following:
None of those 4 tests worked. Also, I ran composer update to make sure I wasn't missing anything and I got a "Nothing to update" response so I believe I am working with latest develop branch. And also, I deleted the test file before each test to make sure. |
@surefirejack F**k ! I don't see where the problem is. Keynote doesn't give any errors or informations ? or log ? |
@surefirejack Could you edit your file "PhpPowerpoint/Writer/PowerPoint2007/PptProps.php" ? public function writeViewProps()
{
// Create XML writer
$objWriter = $this->getXMLWriter();
// XML header
$objWriter->startDocument('1.0','UTF-8','yes');
// p:viewPr
$objWriter->startElement('p:viewPr');
$objWriter->writeAttribute('xmlns:a', 'http://schemas.openxmlformats.org/drawingml/2006/main');
$objWriter->writeAttribute('xmlns:r', 'http://schemas.openxmlformats.org/officeDocument/2006/relationships');
$objWriter->writeAttribute('xmlns:p', 'http://schemas.openxmlformats.org/presentationml/2006/main');
// p:normalViewPr
$objWriter->startElement('p:normalViewPr');
// p:restoredLeft
$objWriter->startElement('p:restoredLeft');
$objWriter->writeAttribute('sz', '15620');
$objWriter->endElement();
// p:restoredTop
$objWriter->startElement('p:restoredTop');
$objWriter->writeAttribute('sz', '94660');
$objWriter->endElement();
$objWriter->endElement();
// p:slideViewPr
$objWriter->startElement('p:slideViewPr');
// p:cSldViewPr
$objWriter->startElement('p:cSldViewPr');
// p:cViewPr
$objWriter->startElement('p:cViewPr');
$objWriter->writeAttribute('varScale', '1');
// p:scale
$objWriter->startElement('p:scale');
// a:sx
$objWriter->startElement('a:sx');
$objWriter->writeAttribute('n', '70');
$objWriter->writeAttribute('d', '100');
$objWriter->endElement();
// a:sy
$objWriter->startElement('a:sy');
$objWriter->writeAttribute('n', '70');
$objWriter->writeAttribute('d', '100');
$objWriter->endElement();
$objWriter->endElement();
// p:origin
$objWriter->startElement('p:origin');
$objWriter->writeAttribute('x', '-516');
$objWriter->writeAttribute('y', '-90');
$objWriter->endElement();
$objWriter->endElement();
// p:guideLst
$objWriter->startElement('p:guideLst');
// p:guide
$objWriter->startElement('p:guide');
$objWriter->writeAttribute('orient', 'horz');
$objWriter->writeAttribute('pos', '2160');
$objWriter->endElement();
// p:guide
$objWriter->startElement('p:guide');
$objWriter->writeAttribute('pos', '2880');
$objWriter->endElement();
$objWriter->endElement();
$objWriter->endElement();
$objWriter->endElement();
// p:notesTextViewPr
$objWriter->startElement('p:notesTextViewPr');
// p:cViewPr
$objWriter->startElement('p:cViewPr');
// p:scale
$objWriter->startElement('p:scale');
// a:sx
$objWriter->startElement('a:sx');
$objWriter->writeAttribute('n', '1');
$objWriter->writeAttribute('d', '1');
$objWriter->endElement();
// a:sy
$objWriter->startElement('a:sy');
$objWriter->writeAttribute('n', '1');
$objWriter->writeAttribute('d', '1');
$objWriter->endElement();
$objWriter->endElement();
// p:origin
$objWriter->startElement('p:origin');
$objWriter->writeAttribute('x', '0');
$objWriter->writeAttribute('y', '0');
$objWriter->endElement();
$objWriter->endElement();
$objWriter->endElement();
// p:gridSpacing
$objWriter->startElement('p:gridSpacing');
$objWriter->writeAttribute('cx', '76200');
$objWriter->writeAttribute('cy', '76200');
$objWriter->endElement();
$objWriter->endElement();
// Return
return $objWriter->getData();
} And test again ? Hard to test with access to Keynote or Keynote Online ? Sorry :) |
@Progi1984 Here's what I'm using to test now: /vendor/phpoffice/phppowerpoint/samples/Sample_01_Simple.php First I switched back to dev-master to confirm that the demo will open in OpenOffice. It does. I tried that with Keynote, just in case. No luck. Then I switched to dev-develop and did composer update and composer dump-autoload Tested without any changes. But nothing I tried worked with Keynote. They did continue to work with OpenOffice. |
Hopefully this video and file will help https://www.dropbox.com/s/u7ys8wgcdaf556o/phppowerpoint-demo.zip?dl=0 |
@surefirejack S**t ! I don't understand why this simple PowerPoint2007 file can't be opened in Keynote ! |
These are the only two error log entries when I try to open the ppt file |
@surefirejack It seems that these errors are not linked to our problem. |
@surefirejack Small question : have you these two patchs applied in your code : #47 (comment) ? These patches have corrected corrupted PPTX for PowerPoint2007 & PowerPoint2010. |
@Progi1984 I created files with latest dev version, and with changes on method Both #47 patches are applied in latest dev code I used in ppt file generation. |
@Djuki ppt => pptx ? |
@Progi1984 Files extension is ppt |
@Djuki But you use PowerPoint2007 writer (so there are OpenXML files (pptx)). |
@Progi1984 Yes Writer is PowerPoint2007
But filename is with ppt extension.
|
When I create the ppt file it does not open with either OpenOffice or Keynote. I am going to try one of the test files that comes with the library and see if I get a different result |
Sample_01_Simple.php in samples directory created a ppt that I could open with Open Office but not latest Keynote. |
@surefirejack It doesn't open with OpenOffice (which version ?) or Keynote. But do it open with LibreOffice ? Wow, that begins to be hard to test without access to Keynote 😟 |
@PHPOffice/phpword-team / @PHPOffice/phppowerpoint-team Noone in the team has a Mac for testing what the problem is with Keynote and helping @surefirejack & @Djuki ? References : #46 (comment) |
@surefirejack @Djuki Always the problem with the version 0.3 ? |
@surefirejack Have you ever had a working version of PHPPowerpoint running with Keynote ? 0.2 ? 0.3 ? |
@Progi1984 No. We have never been able to get it to work with Keynote. Would love to. Do you believe this is fixed or are you waiting for us to re-test? |
@surefirejack And with the version 0.2 ? You can test with the last version of dev. Some errors in PPTX format have been fixed. |
Ok, I'll ask @Djuki to help me run a test. |
@Djuki @surefirejack Hi, since the last commit efa7bd6, PHPPowerPoint create valid openxml. May be that could fix this bug with Keynote. Could you test and give me some feedback ? Thx |
@Progi1984 I tested with dev-master and simple test didn't work. See here: |
BTW - It opens in Keynote 5.3 but not the current, which is 6+ |
@surefirejack Yes, good news... Doesn't an old version of PHPPowerpoint work with Keynote 5.3 ? Now, what's it's the evolution with Keynote 6+ ? |
@Progi1984 I think there was never an issue with opening PHPPowerPoint files using Keynote 5.3 The issue is with Keynote 6+ I really don't know why it is, but it doesn't appear that the latest commits have fixed this. |
@surefirejack I found the support table of PPTX by Keynote but no infos. I agree with you... I must to find a way for fixing that : error log for Keynote ? changes between Keynote 5.3 & Keynote 6 for PPTX support ? others ... We will find a solution. |
@surefirejack Never give up ! Two ideas come to me this night. First idea : $objWriter->writeElement('a:masterClrMapping', ''); By $objWriter->writeElement('a:masterClrMapping', null); Link : scanny/python-pptx#80 (comment) Second idea : Project : https://github.com/scanny/python-pptx (Poke @scanny) |
@Progi1984 I changed the line, but it wasn't line 160. Was line 156. Changed to null and tried. Test failed to create a pptx that could be opened with Keynote 6. And although I don't know really how to run the Python code, I downloaded the files from Github and found that the pptx files in the tests directory work great with Keynote 6. Here's an example: /python-pptx-master/tests/test_files/test_slides.pptx |
@surefirejack Thanks :) Could you test with https://github.com/scanny/python-pptx/blob/master/tests/test_files/test.pptx ? |
@Progi1984 Yes that one works too. |
@surefirejack I fix some Unicode issues and some relations missings. Could you test again with the last develop branch ? Thx |
@Progi1984 Boooya! That worked! You're the man. |
@surefirejack It's a pleasure to close it :) Thanks to you for your help in testing and Happy New Year :) |
Actually, @Djuki have some problems for reading PPTX in Keynote.
I added a patch for CodePlex (92ffaf4 - 29a3321 (Fix) - c0ef044 (Fix)).
But they always have a problem.
Now, could you send me a PPTX file created by Keynote, plz ? Thx
The text was updated successfully, but these errors were encountered: