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

Unwanted changes made while trying to edit a docx file. #566

Open
mayankitt opened this issue Jul 1, 2015 · 0 comments
Open

Unwanted changes made while trying to edit a docx file. #566

mayankitt opened this issue Jul 1, 2015 · 0 comments

Comments

@mayankitt
Copy link

mayankitt commented Jul 1, 2015

I wrote some code to edit documents through phpWord. But the changes didn't take effect and there were some unwanted changes. When I tried to simply load the file into the buffer and save it to the disk without making any changes to the document, the changes still persisted.
The code I used:

$source = "demoFile.docx";
$phpWordObj = \PhpOffice\PhpWord\IOFactory::load($source);

$objWriter = \PhpOffice\PhpWord\IOFactory::createWriter($phpWordObj, 'Word2007');
$objWriter->save('demoFileUpdate.docx');

The screenshots of the original and updated files are given below:
demoFile.docx screenshot

demoFileUpdate.docx screenshot

A detailed explaination of my problem can be seen here

Hope to resolve this at the earliest.


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

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

No branches or pull requests

2 participants