PHPOffice / PHPPresentation

A pure PHP library for reading and writing presentations documents
https://phpoffice.github.io/PHPPresentation
Other
1.31k stars 523 forks source link

PPTX with Charts : Compatibility with Keynote #308

Open Progi1984 opened 7 years ago

Progi1984 commented 7 years ago

PPTX with Charts are not compatible with Keynote.

Poke @informed-source

Progi1984 commented 7 years ago

@informed-source : I may have find the problem with Keynote. Could you download and test these two files ?

OutputChart_PowerPoint.pptx OutputChart_LibreOffice.pptx

If it's what I think :

🎵 Suspense 🎵 If you have the problem, Keynote only support embedding spreadsheets for chart. ``` $chart->setIncludeSpreadsheet(true);```
informed-source commented 7 years ago

Checking...

informed-source commented 7 years ago

I can confirm that behaviour. OutputChart_PowerPoint.pptx opens in PowerPoint and Keynote and displays chart as expected. OutputChart_LibreOffice.pptx opens in PowerPoint and displays chart as expected; fails to open in Keynote with error: "... can't be opened for some reason."

Progi1984 commented 7 years ago

@informed-source : So If you have the problem, Keynote only support embedding spreadsheets for chart.

You need to use in your chart for Keynote :

$chart->setIncludeSpreadsheet(true);
informed-source commented 7 years ago

Thanks, will check.

So, output .pptx from Sample_05_Chart.php opens in PowerPoint but does not open in Keynote. The output .pptx from Sample_05_Chart_with_PHPExcel.php opens in PowerPoint, and opens in Keynote but does not display the chart on the first slide but the pie chart on the second slide displays.

I have created a simple test file based on the charts I am attempting to generate. This already includes the reference to setIncludeSpreadsheet(true) based on the example in Sample_05_Chart_with_PHPExcel.php.

simple.php.zip

The pptx output from simple.php opens as expected in PowerPoint, but opens with an error ('An unknown error occurred') in Keynote and does not display the chart.

Can you spot anything wrong with the file simple.php?

Many thanks again for investigating this.