我正在从我的database.It生成Powerpoint在ubuntu上运行良好,但不显示在windows.Only空白ppt显示.In窗口空白ppt是generated.my代码是
//创建幻灯片
$currentSlide = $objPHPPowerPoint->getActiveSlide();//创建一个形状(绘图)
$shape = $currentSlide->createDrawingShape();
$shape->setName('PHPPresentation logo')
->setDescription('PHPPresentation logo')
->setPath(base_path().'/public/images/pp_bg.jpg')
->setHeight(36)
->setOffsetX(10)
->setOffsetY(10);
$shape->getShadow()->setVisible(true)
->setDirection(45)
->setDistance(10);//创建一个形状(文本)
$shape = $currentSlide->createRichTextShape()
->setHeight(300)
->setWidth(600)
->setOffsetX(170)
->setOffsetY(180);
$shape->getActiveParagraph()->getAlignment()->setHorizontal( Alignment::HORIZONTAL_CENTER );
$textRun = $shape->createTextRun('Thank you for using PHPPresentation!');
$textRun->getFont()->setBold(true)
->setSize(60)
->setColor( new Color( 'FFE06B20' ) );
// generate PPT file.
$oWriterPPTX = IOFactory::createWriter($objPHPPowerPoint, 'PowerPoint2007');
$oWriterPPTX->save("Proposal $id.ppt");
$file_url = "Proposal $id.ppt";
header('Content-Description: File Transfer');
header('Content-Type: application/vnd.openxmlformats-officedocument.presentationml.presentation');
header('Content-Disposition: attachment; filename='.basename($file_url));
header('Content-Transfer-Encoding: binary');
header('Expires: 0');
header('Cache-Control: must-revalidate');
header('Pragma: public');
header('Content-Length: ' .filesize($file_url));
readfile($file_url);https://stackoverflow.com/questions/41355820
复制相似问题