这有效
$text = $textrun->addText($organization['name']);
$text->setFontStyle($textFontStyleBold);
$text->setParagraphStyle($textParagraphStyle);
但是...
$textrun = $section->createTextRun();
$textrun->setParagraphStyle($textParagraphStyle);
$text = $textrun->addText($organization['name']);
$text->setFontStyle($textFontStyleBold);
$text->setParagraphStyle($textParagraphStyle);
$text = $textrun->addText(", bla_bla");
$text->setFontStyle($textFontStyle);
$text->setParagraphStyle($textParagraphStyle);
// var_dump ($textrun)
// protected 'paragraphStyle' => null
答案 0 :(得分:0)
$ textrun = $ section-> createTextRun($ textParagraphStyle);