downloadTemp2014 2017-06-15 11:36
浏览 414
已采纳

如何更改PHPPresentation幻灯片的背景颜色?

I've recently started to work with the PHPPresentation library to create Powerpoint presentations. I need to change the background color of certain slides, I looked over the code samples that they offer and inside the developer documentation, they both lack this vital information.

https://github.com/PHPOffice/PHPPresentation/tree/develop/samples http://phppresentation.readthedocs.io/en/latest/slides.html

  • 写回答

1条回答 默认 最新

  • dongshenghe1833 2017-06-15 20:47
    关注

    I downloaded the repository from github and searched for 'background'. There were quite a few results, both in samples and the source code.

    One example is Sample 15. Below is an excerpt from lines 14-23:

    // Create slide
    echo date('H:i:s') . ' Create slide'.EOL;
    $oSlide1 = $objPHPPresentation->getActiveSlide();
    $oSlide1->addShape(clone $oShapeDrawing);
    $oSlide1->addShape(clone $oShapeRichText);
    // Slide > Background > Color
    $oBkgColor = new Color();
    $oBkgColor->setColor(new StyleColor(StyleColor::COLOR_DARKGREEN));
    $oSlide1->setBackground($oBkgColor);
    

    It appears that method setBackground() is defined in AbstractSlide.php at line 349 as of revision d07784c.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 報錯:Person is not mapped,如何解決?
  • ¥15 c++头文件不能识别CDialog
  • ¥15 Excel发现不可读取的内容
  • ¥15 关于#stm32#的问题:CANOpen的PDO同步传输问题
  • ¥20 yolov5自定义Prune报错,如何解决?