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

Text missing in PowerPoint, but shows up in Google Slides, LibreOffice Impress #767

Open
DeveloperMCD opened this issue Dec 1, 2023 · 0 comments

Comments

@DeveloperMCD
Copy link

I have a very simple example, with a lot of code similar to below.
I thought everything was going great -- no errors, everything showing up as intended.
But only in LibreOffice (Impress) or Google Suite (Slides).
When my boss checked it out with actual Microsoft Powerpoint, only the upper-right graphic (logo) appeared, as well as a bunch of empty rectangles (should have text in them).
All the text is invisible/not there. Only in Powerpoint.

How can this be? This is a very basic Powerpoint file, saved in this way:
$oWriterPPTX = IOFactory::createWriter($presentation, 'PowerPoint2007');
$oWriterPPTX->save(DIR . "/ppt/sample.pptx");

Is the PPTX extension the problem? Maybe because it's only a PPT, so Microsoft is interpreting the file horribly wrong (compared to their competitors, who do a fine job)?

I'm using the latest version of PHPPresentation (downloaded a few days ago) and

PHP 8.2.12 (cli) (built: Oct 26 2023 17:33:26) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.2.12, Copyright (c) Zend Technologies
with Zend OPcache v8.2.12, Copyright (c), by Zend Technologies
with Xdebug v3.2.1, Copyright (c) 2002-2023, by Derick Rethans

Here is the code I'm using:

// Create a shape (text)
$shape = $nextSlide->createRichTextShape()
->setHeight(450)
->setWidth(560)
->setOffsetX(320)
->setOffsetY(175);
$shape->getActiveParagraph()->getAlignment()->setHorizontal( Alignment::HORIZONTAL_CENTER );

$shape->getBorder()
->setLineStyle(Border::LINE_SINGLE)
->setLineWidth(2)
->getColor()->setARGB('FF000000');

$textRun = $shape->createTextRun("Foo bar");
$textRun->getFont()->setBold(true)
->setSize(14)
->setColor( new Color('000000') );

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

1 participant