【问题标题】:PHPWORD: I can't set property 'paragraphStyle' in textrunPHPWORD:我无法在 textrun 中设置属性“paragraphStyle”
【发布时间】:2016-11-21 10:38:13
【问题描述】:

这行得通

$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

【问题讨论】:

    标签: php phpword


    【解决方案1】:

    $textrun = $section->createTextRun($textParagraphStyle);

    【讨论】:

      猜你喜欢
      • 2016-05-06
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-03-17
      相关资源
      最近更新 更多