PHPOffice / PHPPresentation

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

Repair issue when opening the file in Microsoft Powerpoint 2010 #310

Open nitishkh opened 7 years ago

nitishkh commented 7 years ago

Hi Guys,

I'm getting an issue when opening the file in powerpoint 2010 as I'm writing it back to 2007. I have applied a image background in all 3 of my slides. It says "This image currently cannot be displayed" when I open the written file. My png turns to a jpg file as well. I have attached the ppt files below:

sample.pptx TriviaJointSlides.pptx Here is my simple code:

require_once 'vendor/autoload.php';
include_once 'Sample_Header.php';

use PhpOffice\PhpPresentation\IOFactory;
use PhpOffice\PhpPresentation\Slide;
use PhpOffice\PhpPresentation\Shape\RichText;

$pptReader = IOFactory::createReader('PowerPoint2007');
$oPHPPresentation = $pptReader->load('TriviaJointSlides.pptx');

// Create slide

//$objPHPPowerPoint->addSlide();
$oTree = new PhpPptTree($oPHPPresentation);
echo $oTree->display();
if (!CLI) {
    include_once 'Sample_Footer.php';
}

$oWriterPPTX = IOFactory::createWriter($oPHPPresentation, 'PowerPoint2007');
$oWriterPPTX->save(__DIR__ . "/sample.pptx");
--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/40921039-repair-issue-when-opening-the-file-in-microsoft-powerpoint-2010?utm_campaign=plugin&utm_content=tracker%2F323104&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F323104&utm_medium=issues&utm_source=github).
Progi1984 commented 7 years ago

@nitishkh Have you got the problem with the latest version of develop branch ?

nitishkh commented 7 years ago

Thanks for the reply Progi1984. Yes I'm using the latest develop branch files. The repair issue keeps coming out as I open the newly generated powerpoint. I have attached my ppt files above and my codes seem to be fine.

nitishkh commented 7 years ago

I'm adding a bounty of $10 to whoever can help us solve this issue.

Cheers

abhikakade commented 7 years ago

I also facing similar issues, with the sample code of Sample_01_simple.php. I am also using latest version of phppresentation i.e. as per composer 0.7.0 (but version file inside package says 0.6.0). I tried it with office 2010 and 2013 getting repair error mentioned above. Appreciated any help on this.

abhikakade commented 7 years ago

Similar issue in Office 2016, generated PPT is not opening at all even after clicking on repair option :(

abhikakade commented 7 years ago

HI Everyone - Checked out code from DEV-Master branch again and solved this issue for me, Now PPT is opening in both MS - Office 2013 & 2016.

diogo-garcia commented 7 years ago

Same problem here, even if I just generate a empty pptx it asks me to repair and then it works properly... I'm using PHPPresentation-0.7.0 downloaded and Common-0.2.6 both downloaded manually.

eL-Prova commented 7 years ago

@abhikakade what was your fix? Maybe you can fix it for this repo?

abhikakade commented 7 years ago

The issue was with master branch .. I checked out dev branch code and that fixed repair issue for me.

On Mar 1, 2017 12:30 AM, "eL-Prova" notifications@github.com wrote:

@abhikakade https://github.com/abhikakade what was your fix? Maybe you can fix it for this repo?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/PHPOffice/PHPPresentation/issues/310#issuecomment-283130841, or mute the thread https://github.com/notifications/unsubscribe-auth/AOpiWXl1-Nf2d9IL1DTlNzfMt5LZjnb-ks5rhG7ggaJpZM4LizUB .

Progi1984 commented 7 years ago

@nitishkh : Could you test with the latest version of the develop branch ?

xbitres commented 7 years ago

@Progi1984 I also just updated to the development version and it still continues giving me a error asking for a repair. This happens on Windows 365 version as well as Mac version...