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

mac can not open saved content #274

Closed
zhaozhi406 opened this issue Sep 23, 2016 · 2 comments
Closed

mac can not open saved content #274

zhaozhi406 opened this issue Sep 23, 2016 · 2 comments
Milestone

Comments

@zhaozhi406
Copy link

zhaozhi406 commented Sep 23, 2016

I tried the example code which is on the documentation page, but I can not open the saved pptx file, what I mean is that I double clicked the saved file in finder, nothing displayed and no exception jumped out.

So I tried another way, first I saved an empty pptx file use the microsoft powerpoint app, second I read the file in my code, and then I added some text, and save. Then in the finder, I can open the saved file and see the content which I added in the code. Why?

Below is my code:

       $reader = IOFactory::createReader("PowerPoint2007");

       $objppt = $reader->load("empty.pptx");

       $shape = $objppt->getActiveSlide()->createRichTextShape()
            ->setHeight(300)
            ->setWidth(600)
            ->setOffsetX(170)
            ->setOffsetY(180);

        $shape->getActiveParagraph()->getAlignment()->setHorizontal( Alignment::HORIZONTAL_CENTER );
        $textRun = $shape->createTextRun('Thank you for using PHPPresentation!');
        $textRun->getFont()->setBold(true)
            ->setSize(60)
            ->setColor( new Color( 'FFE06B20' ) );

        $w = IOFactory::createWriter($objppt, 'PowerPoint2007');
        $w->save(__DIR__ . "/from-empty.pptx");

@Progi1984
Copy link
Member

@zhaozhi406 Could you test this PR #303 ? Thanks

@Progi1984
Copy link
Member

@zhaozhi406 The PR #303 has been merged. Thanks.

@Progi1984 Progi1984 added this to the 0.8.0 milestone Jan 9, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants