Skip to content

Commit ca69de3

Browse files
committed
PHPOffice#23 : Implement Word97 aka MsDoc Reader
1 parent df8de96 commit ca69de3

File tree

5 files changed

+2168
-1179
lines changed

5 files changed

+2168
-1179
lines changed

samples/Sample_11_ReadWord97.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@
55
$name = basename(__FILE__, '.php');
66
$source = "resources/{$name}.doc";
77
echo date('H:i:s'), " Reading contents from `{$source}`", EOL;
8-
$phpWord = \PhpOffice\PhpWord\IOFactory::load($source, 'Word97');
8+
$phpWord = \PhpOffice\PhpWord\IOFactory::load($source, 'MsDoc');
99

1010
// (Re)write contents
11-
/*$writers = array('Word2007' => 'docx', 'ODText' => 'odt', 'RTF' => 'rtf');
11+
$writers = array('Word2007' => 'docx', 'ODText' => 'odt', 'RTF' => 'rtf');
1212
foreach ($writers as $writer => $extension) {
1313
echo date('H:i:s'), " Write to {$writer} format", EOL;
1414
$xmlWriter = \PhpOffice\PhpWord\IOFactory::createWriter($phpWord, $writer);
1515
$xmlWriter->save("{$name}.{$extension}");
1616
rename("{$name}.{$extension}", "results/{$name}.{$extension}");
17-
}*/
17+
}
1818

1919
include_once 'Sample_Footer.php';

samples/Sample_Header.php

+3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
<?php
2+
3+
date_default_timezone_set('Europe/Paris');
4+
25
/**
36
* Header file
47
*/

0 commit comments

Comments
 (0)