1
PHPPowerPoint是一个伟大的图书馆,但它没有文件。将图像添加到幻灯片的正确语法是什么?如何使用PHPPowerPoint将图像添加到幻灯片?
PHPPowerPoint是一个伟大的图书馆,但它没有文件。将图像添加到幻灯片的正确语法是什么?如何使用PHPPowerPoint将图像添加到幻灯片?
每个图形对象都被视为一个“形状”。这里是图像插入幻灯片方式:
// Create slide 1
$currentSlide = createTemplatedSlide($objPHPPowerPoint);
//Slide Content
$shape = $currentSlide->createDrawingShape();
$shape->setName('Part page');
$shape->setDescription('Page');
$shape->setPath('D:\wamp\www\Project\PPTResource\Part2\Image.jpg'); //This being the directory, wont be the same as mine.
$shape->setOffsetX(10); //Default values on position of image
$shape->setOffsetY(10);
$shape->getShadow()->setVisible(true);
$shape->getShadow()->setDirection(45);
$shape->getShadow()->setDistance(10);
$currentSlide = createTemplatedSlide($objPHPPowerPoint);
// createTemplatedSlide is manual function in PHPpowerPoint
// create a drawing shape object
$shape1 = $currentSlide->createDrawingShape();
$shape1->setName("set name here");
$shape1->setDescription('Link Image');
$shape1->setPath('provide image path here');
$shape1->setWidth(45); // set width
$shape1->setHeight(45); // set height
$shape1->setOffsetX($offset_X); // distance from the left side of the slide
$shape1->setOffsetY($offset_Y); // distance from top of the slide
有你下载的源代码是,他们有一个叫做'Test'文件夹,显示你如何做到这一点的'01simple.php '例子 – PhearOfRayne