0

我想使用 php 演示文稿从 laravel 中的 pptx 文件中访问 Word 我试过了,但它不起作用。请提供任何输入。

$slides = $oPHPPresentation2->getSlide(7);
$shape=$slides->getShapeCollection();
$paragraphs = $shape->getParagraphs();
foreach ($paragraphs as $paragraph_k => $paragraph_v) 
{
    $text_elements = $paragraph_v->getRichTextElements();
    foreach ($text_elements as $text_element_k => $text_element_v) 
    {
        $text = $text_element_v->getText();
        $new_text = str_replace('[[recommendations]]','Pranjal', $text);
        $text_element_v->setText($new_text);
    }
}
4

0 回答 0