【问题标题】:How to stretch the footer to the full width of the page using phpword?如何使用phpword将页脚拉伸到页面的整个宽度?
【发布时间】:2020-01-04 09:38:17
【问题描述】:

我使用 PHPWord 生成文档。 如何删除页脚左侧的缩进,使其占据整个宽度?

对于标题,我使用:

$header = $section->addHeader();
        $header->addImage('images/header.png',
            array(
                'width'=>600,
                'height'=>72,
                'marginLeft' => -75,
                'positioning'=>'absolute',
                'wrappingStyle'=> 'behind',
                'posHorizontal' => 'absolute',
                'posVertical' => 'absolute'
            ));

但是对于页脚它不起作用。

$footer = $section->addFooter();
        $footer->addImage('images/footer.png',
            array(
                'width'=>600,
                'height'=>72,
                'marginLeft' => -75,
                'positioning'=>'absolute',
                'posHorizontal' => 'absolute',
                'posVertical' => 'absolute',
            ));

第二个问题,是否可以使用 phpword 将文本放在页脚中的图像顶部?

【问题讨论】:

    标签: php doc phpword


    【解决方案1】:

    我解决了我的问题。 我用于页脚:

    $footer->addImage('images/footer.png',
                array(
                    'width'=>600,
                    'height'=>72,
                    'positioning' => \PhpOffice\PhpWord\Style\Image::POSITION_ABSOLUTE,
                    'posHorizontal' => \PhpOffice\PhpWord\Style\Image::POSITION_ABSOLUTE,
                    'posVertical' => \PhpOffice\PhpWord\Style\Image::POSITION_ABSOLUTE,
                    'marginLeft' => -75,
                    'marginTop'=>-50,
                    'wrappingStyle'=> 'behind'
                ));
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-03-25
      • 2015-02-05
      • 1970-01-01
      • 2013-12-25
      • 2015-09-02
      相关资源
      最近更新 更多