Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Style Loss of word 2007 file #1069

Closed
NingerJohn opened this issue Jun 1, 2017 · 1 comment
Closed

Style Loss of word 2007 file #1069

NingerJohn opened this issue Jun 1, 2017 · 1 comment

Comments

@NingerJohn
Copy link

NingerJohn commented Jun 1, 2017

I met the style loss issue by running the following code. I barely change the original file 1.docx, however after I save it as helloWorld.docx and open it, I found the style of table, header, footer was lost.

// Read a docx file
$source = './temp/1.docx';
$phpWord = \PhpOffice\PhpWord\IOFactory::load($source, 'Word2007');
// Saving the document as OOXML file...
$objWriter = \PhpOffice\PhpWord\IOFactory::createWriter($phpWord, 'Word2007');
$objWriter->save('./temp/helloWorld.docx');
@chrisribe
Copy link

Yes this seems to be a general issue with PHPWord.
Loading any document with a style is lost. I cannot seem to find a way to load a document with styles and reuse them with other created documents. Like a styles template.

Did you find a workaround ?
Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants