I have some issue when i saving RTF file with phpword lib.
I open an RTF file with IOFactory::load
, then i save it with function write and I have some metadata on the file i don't know why.
Here is my code:
<?php
include_once 'vendor/phpoffice/phpword/samples/Sample_Header.php';
// Read contents
$name = 'Sample';
$source = __DIR__ . "/vendor/phpoffice/phpword/samples/resources/{$name}.rtf";
echo date('H:i:s'), " Reading contents from `{$source}`", EOL;
$phpWord = \PhpOffice\PhpWord\IOFactory::load($source, 'RTF');
// Save file
echo write($phpWord, basename(__FILE__, '.php'), $writers);
include_once 'vendor/phpoffice/phpword/samples/Sample_Footer.php';
and when i open the new file who have been save It shows:
"Normal;Default Paragraph Font;Normal Table;Body Text;Corps de texte Car;footer;Pied de page Car;page number;Balloon Text;Texte de bulles Car;?;;?;;?;;?;?;?;?;?;?;;http://schemas.microsoft.com/office/word/2003/wordml2450
6
1
...)()()()()()Annexe I"
If someone have an idea why I have some metadata on my file that will be good.