Sample 11 ReadWord97

01:24:50 Reading contents from `resources/Sample_11_ReadWord97.doc`
01:24:50 Write to Word2007 format
01:24:50 Write to ODText format
01:24:50 Write to RTF format
01:24:50 Write to HTML format
01:24:50 Write to PDF format
01:24:50 Done writing file(s)
01:24:50 Peak memory usage: 4 MB

 

Results: docx odt rtf html pdf


<?php

include_once 'Sample_Header.php';

// Read contents
$name basename(__FILE__'.php');
$source "resources/{$name}.doc";
echo 
date('H:i:s'), " Reading contents from `{$source}`"EOL;
$phpWord = \PhpOffice\PhpWord\IOFactory::load($source'MsDoc');

// Save file
echo write($phpWordbasename(__FILE__'.php'), $writers);
if (!
CLI) {
    include_once 
'Sample_Footer.php';
}