Nessuna descrizione

Sample_18_Watermark.php 578B

12345678910111213141516171819
  1. <?php
  2. include_once 'Sample_Header.php';
  3. // New Word document
  4. echo date('H:i:s'), ' Create new PhpWord object', EOL;
  5. $phpWord = new \PhpOffice\PhpWord\PhpWord();
  6. // Begin code
  7. $section = $phpWord->addSection();
  8. $header = $section->addHeader();
  9. $header->addWatermark('resources/_earth.jpg', array('marginTop' => 200, 'marginLeft' => 55));
  10. $section->addText(htmlspecialchars('The header reference to the current section includes a watermark image.'));
  11. // Save file
  12. echo write($phpWord, basename(__FILE__, '.php'), $writers);
  13. if (!CLI) {
  14. include_once 'Sample_Footer.php';
  15. }