No Description

Sample_28_ReadRTF.php 393B

123456789101112131415
  1. <?php
  2. include_once 'Sample_Header.php';
  3. // Read contents
  4. $name = basename(__FILE__, '.php');
  5. $source = __DIR__ . "/resources/{$name}.rtf";
  6. echo date('H:i:s'), " Reading contents from `{$source}`", EOL;
  7. $phpWord = \PhpOffice\PhpWord\IOFactory::load($source, 'RTF');
  8. // Save file
  9. echo write($phpWord, basename(__FILE__, '.php'), $writers);
  10. if (!CLI) {
  11. include_once 'Sample_Footer.php';
  12. }