PHPOffice / PHPPresentation

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

Insert PDF image #316

Open Kieryn19 opened 7 years ago

Kieryn19 commented 7 years ago

Hi, I am trying to add a PDF image into powerpoint. It works in PowerPoint for Mac, but not in Windows versions of PowerPoint.

$shape = $currentSlide->createDrawingShape();
$shape->setName('pdfimage')
    ->setDescription('pdfimage')
    ->setPath(dirname(__DIR__).'/PDFs/pdfImage.pdf')
    ->setResizeProportional(false)
    ->setWidth(200)
    ->setHeight(200)
    ->setOffsetX(10)
    ->setOffsetY(10);
$oWriterPPTX = IOFactory::createWriter($objPHPPowerPoint, 'PowerPoint2007');
$oWriterPPTX->save(dirname(__DIR__).'/PDFs/output.pptx');
Progi1984 commented 7 years ago

@Lews19 PDF file are not supported. I need to make some tests.

Progi1984 commented 2 months ago

@Kieryn19 Hi, Have you got a sample file with an embed PDF file ?