Open AashayThakurMMX opened 6 years ago
@AashayThakurMMX Hi could you give us a sample file for testing, please ? Thank you
Text lost below 2010.
On Wed, Oct 3, 2018 at 5:51 PM Progi1984 notifications@github.com wrote:
@AashayThakurMMX https://github.com/AashayThakurMMX Hi could you give us a sample file for testing, please ? Thank you
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/PHPOffice/PHPPresentation/issues/494#issuecomment-426617200, or mute the thread https://github.com/notifications/unsubscribe-auth/AnlnKUZmy-JAT5gy3QLInQh5t0THG-UAks5uhKvUgaJpZM4V8Uhr .
@AashayThakurMMX Hi could you give us a sample file (PPTX extension) for testing, please ? Thank you
Here is an example that doesn't work below 2010.
@janetthecoder Have you the code for generating this file, please ?
@Progi1984 Here you go
<?php
require_once(__DIR__.'/../../PHPPresentation-master/src/PhpPresentation/Autoloader.php');
\PhpOffice\PhpPresentation\Autoloader::register();
require_once(__DIR__.'/../../phpcommon/src/Common/Autoloader.php');
\PhpOffice\Common\Autoloader::register();
require_once(__DIR__.'/../../PHPPresentation-master/src/PhpPresentation/Shape/RichText.php');
require_once(__DIR__.'/../../PHPPresentation-master/src/PhpPresentation/Writer/PowerPoint2007/LayoutPack/AbstractLayoutPack.php');
use PhpOffice\PhpPresentation\PhpPresentation;
use PhpOffice\PhpPresentation\Style\Alignment;
use PhpOffice\PhpPresentation\Style\Bullet;
use PhpOffice\PhpPresentation\Style\Color;
use PhpOffice\PhpPresentation\IOFactory;
use PhpOffice\PhpPresentation\Shape;
use PhpOffice\PhpPresentation\Autoloader;
use PhpOffice\PhpPresentation\Settings;
use PhpOffice\PhpPresentation\Slide;
use PhpOffice\PhpPresentation\AbstractShape;
use PhpOffice\PhpPresentation\DocumentLayout;
use PhpOffice\PhpPresentation\Shape\Drawing;
use PhpOffice\PhpPresentation\Shape\RichText\Run;
use PhpOffice\PhpPresentation\Shape\RichText\Paragraph;
require_once(__DIR__ . '/../../../config.php');
$objPHPPresentation = new PhpPresentation();
$objPHPPresentation->removeSlideByIndex(0);
$currentSlide = $objPHPPresentation->createSlide();
$shape = $currentSlide->createRichTextShape()
->setHeight(150)
->setWidth(350)
->setOffsetX(170)
->setOffsetY(180)
->setAutoFit( 'spAutoFit' );
$textRun = $shape->createTextRun( "Thank you for using PHPPresentation! Thank you for using PHPPresentation!" );
$shape->createBreak();
$textRun = $shape->createTextRun( "Thank you for using PHPPresentation! Thank you for using PHPPresentation!" );
$textRun->getFont()->setSize(14)
->setBold(false);
// $shape->createBreak();
$shape->createBreak();
$ppt_store_path = "/xxx/ppt/test_ppt.pptx";
$oWriterPPTX = IOFactory::createWriter($objPHPPresentation, 'PowerPoint2007');
$oWriterPPTX->save($ppt_store_path);
echo $ppt_store_path;
?>
Not able to open in 2007 version but working in 2013 office. newtest-27 (1).pptx
PPTX not open below than office 2010 version
give lost data error & only images show