Forum


Replies: 4   Views: 3218
How can i addimage after header/footer for each page?
Topic closed:
Please note this is an old forum thread. Information in this post may be out-to-date and/or erroneous.
Every phpdocx version includes new features and improvements. Previously unsupported features may have been added to newer releases, or past issues may have been corrected.
We encourage you to download the current phpdocx version and check the Documentation available.

Posted by gh_ost  · 07-12-2017 - 12:44

Hellow! 

I have image of the print our company and this print must be on each page before the text ( i know about watermark and background but this methods doesn't solve the problem) of the document.  

I use insertWordFragment, but it's add elements (after/before) like pharapraph, section, break ( break doesn't found with type = "next" like in example) etc. there not element footer or header

        $image = public_path().'/img/ncste_print_q.png';

        $print = new WordFragment($word, 'document');
        $print->addImage([
            'src' => $image,
            'textWrap' => 2,
            'height' => 100,
            'width' => 350
        ]);

        $word->addBreak(array('type' => 'page'));
        //['type' => 'break', 'attributes' => array('w:type' => 'page'),]
        $word->insertWordFragment($print, ['attributes' => array('w:headerReference' => ''),], 'after' );

So how i can solve this problem?

Regards