2017-11-23 9 views
0

私は現在、ページの上部に以下のコードを含む画像を持っています。コードにmarginTop=> 200を追加してイメージの位置を下げたいが、それはうまくいかない。実際、私は知っているすべてを試しましたが、すべてが失敗しました。誰かがどのようにphpwordのヘッダー内の画像の位置を変更する方法を知っていますか?phpwordヘッダーの画像の位置を変更する方法

$header = $section->addHeader(); 
$header->firstPage(); 
$header->addImage(
    '../images/logo/AVA-Full-Logo-Grey.jpg', 
    array(
    'width'   => 250, 
    'wrappingStyle' => 'square', 
    'marginTop'  => 200, 
    'positioning'  => 'relative', 
    'posHorizontal' => PhpOffice\PhpWord\Style\Image::POSITION_HORIZONTAL_RIGHT, 
    'posHorizontalRel' => 'margin', 
    'posVerticalRel' => 'line', 
) 
); 
+0

をこの答えは役立つかもしれない、それは持っていないので、私は重複としてマークしたくありませんでした受け入れられた答え。 https://stackoverflow.com/questions/29651259/phpword-insert-page-break-and-set-margin-and-page-orientation-using-laravel-4ドキュメントから、正しい方法で作業しているように見えますが、 http://phpword.readthedocs.io/ja/latest/elements.html#images、おそらく何かがスタイルをオーバーライドしています。 – ArtisticPhoenix

答えて

0

それはこのように多くの例の後に、私の仕事:

$header = $section->addHeader(); 
$header->addWatermark(JPATH_SITE.'/libraries/PHPWord-master/headerandfooter/image.png', array('width' => 535, 'height' => 535,'marginTop' => round(\PhpOffice\PhpWord\Shared\Converter::cmToPixel(5.25)),'posHorizontal' => 'absolute','posVertical' => 'absolute')); 
関連する問題