Skip to content

Style & content is missing in when create new pptx file from existing pptx file #594

@niloyniloy

Description

@niloyniloy

Here is existing slide
https://easycaptures.com/fs/uploaded/1444/6674398579.jpg

Here is created via phpPresentation
https://easycaptures.com/fs/uploaded/1444/9748775082.png

`
require_once 'vendor/autoload.php';

use PhpOffice\PhpPresentation\PhpPresentation;
use PhpOffice\PhpPresentation\IOFactory;
use PhpOffice\PhpPresentation\Style\Color;
use PhpOffice\PhpPresentation\Style\Alignment;

function createPPT($template){
$pptLayout = new \PhpOffice\PhpPresentation\DocumentLayout();
$pptLayout->setDocumentLayout($pptLayout::LAYOUT_SCREEN_16X10);
$pptTMPL = \PhpOffice\PhpPresentation\IOFactory::createReader('PowerPoint2007');
//$ppt = $pptTMPL->load("./ppt-template.pptx");
$ppt = $pptTMPL->load("./$template");
$ppt->setLayout($pptLayout);

$oWriterPPTX = IOFactory::createWriter($ppt, 'PowerPoint2007');
$oWriterPPTX->save(__DIR__ . "/sample2.pptx");

}
createPPT("a.pptx", "PowerPoint2007");`

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions