如何在windows操作系统的laravel中生成PPT?
我正在从我的数据库生成Powerpoint。它在ubuntu上运行良好,但在windows上不显示。只显示空白ppt。在windows中生成空白ppt。我的代码是 //创建幻灯片如何在windows操作系统的laravel中生成PPT?,laravel,powerpoint,Laravel,Powerpoint,我正在从我的数据库生成Powerpoint。它在ubuntu上运行良好,但在windows上不显示。只显示空白ppt。在windows中生成空白ppt。我的代码是 //创建幻灯片 $currentSlide = $objPHPPowerPoint->getActiveSlide(); //创建形状(图形) //创建形状(文本) 我不确定,但这可能是因为您使用的字体不存在/未安装到WinOS系统中。尝试使用支持字体(ubuntu+WinOs)。您可以阅读有关PHPPresentat
$currentSlide = $objPHPPowerPoint->getActiveSlide();
//创建形状(图形)
//创建形状(文本)
我不确定,但这可能是因为您使用的字体不存在/未安装到WinOS系统中。尝试使用支持字体(ubuntu+WinOs)。您可以阅读有关PHPPresentation的更多信息 软件包功能 有用链接:
希望这对你有帮助 使用Win OS创建PPT时有错误吗?没有错误,但在PPT幻灯片中没有数据,它是空白的,但在ubuntu中工作正常您的意思是“当您使用winOS打开同一PPT时,它是空白的?”“?是的,它是空白的,打开时说powerpoint无法显示部分文本,文件proposal.ppt中幻灯片上的图像或对象已损坏。受影响的幻灯片已替换为演示文稿中的空白幻灯片,无法恢复丢失的信息。感谢您的回复,但问题仍然没有解决使用laravel中的PhpPresentation软件包我们如何将文件另存为microsoftpowerpoint 97-2003..这将解决我的问题。使用OdpPresentation而不是powerpoint解决了问题2007@BikashBudhathoki:享受
$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);