//设置一个文本框 $shape = $slide->createRichTextShape(); $shape->setHeight(550); $shape->setWidth(820); $shape->setOffsetX(450); $shape->setOffsetY(90); //$shape->getAlignment()->setHorizontal('l'); //正确的调用方法 $shape->getActiveParagraph()->getAlignment()->setHorizontal(Alignment::HORIZONTAL_LEFT); //$shape->getAlignment()->setHorizontal(PhpOffice\PhpPresentation\Style\Alignment::HORIZONTAL_LEFT); //$shape->getAlignment()->setHorizontal('l'); $textRun = $shape->createTextRun($content); // $textRun->getFont()->setBold(true); $textRun->getFont()->setName("Arial"); $textRun->getFont()->setSize(12); $textRun->getFont()->setColor( new Color('FF000000'));
如果本文对你有帮助,欢迎打赏本站