2016-11-17 16 views
1

太字で前後に段落を区切ってインデントしたテキストがあります。 私は3つのプロパティを一緒に使用することはできません。phpWordでのボールド、スペーシング、およびインデントテキスト

これは大胆かつ間隔を置いたために働く:

$section = $phpWord->addSection(); 
$section->addText(
    'Re: Your Application for Post of Security Guard', 
    array('bold' => true), 
    array('space' => array('before' => 360, 'after' => 280)) 
); 

、これはインデントのために動作します:

$section = $phpWord->addSection(); 
$section->addText(
    'Re: Your Application for Post of Security Guard', 
    array('indentation' => array('left' => 540, 'right' => 120)) 
    ); 

が、これは動作しません:

$section = $phpWord->addSection(); 
$section->addText(
    'Re: Your Application for Post of Security Guard', 
    array('bold' => true), 
    array('space' => array('before' => 360, 'after' => 280)), 
    array('indentation' => array('left' => 540, 'right' => 120)) 
); 

誰も私を助けることができますか?

+0

任意のphpWordの専門家がそこに存在しません今日。 – Benjamin

答えて

2

セクションaddText機能は次のとおりです。

$section->addText($text, [$fontStyle], [$paragraphStyle]); 

正しい方法は、1列にあなたの段落スタイルを組み合わせることである。すなわち:私は推測している

$section = $phpWord->addSection(); 
$section->addText(
    'Re: Your Application for Post of Security Guard', 
    array('bold' => true), 
    array(
     'space' => array('before' => 360, 'after' => 280), 
     'indentation' => array('left' => 540, 'right' => 120) 
    ) 
); 
+0

ありがとう、ejuhjav。それは素晴らしいことです! – Benjamin

関連する問題