add exmpales
[pear-examples] / Document_Word_Writer / Examples / Watermark.php
1 <?php
2 require_once '../PHPWord.php';
3
4 // New Word Document
5 $PHPWord = new PHPWord();
6
7 // New portrait section
8 $section = $PHPWord->createSection();
9
10 // Create header
11 $header = $section->createHeader();
12
13 // Add a watermark to the header
14 $header->addWatermark('_earth.jpg', array('marginTop'=>200, 'marginLeft'=>55));
15
16 $section->addText('The header reference to the current section includes a watermark image.');
17
18 // Save File
19 $objWriter = Document_Word_Writer_IOFactory::createWriter($PHPWord, 'Word2007');
20 $objWriter->save('Watermark.docx');
21 ?>