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

Word2007 reader/writer is loosing information #1604

Closed
1 of 3 tasks
akomm opened this issue Mar 25, 2019 · 2 comments
Closed
1 of 3 tasks

Word2007 reader/writer is loosing information #1604

akomm opened this issue Mar 25, 2019 · 2 comments

Comments

@akomm
Copy link

akomm commented Mar 25, 2019

This is:

Expected Behavior

  1. I create a input.docx file (word 2007/2013 xml), with either ms word or libre office writer.
  2. I read it with Word2017 reader & write it with Word2017 writer to output.docx
  3. The output.docx should look like input.docx

Current Behavior

  • Comments made on text are missing.
  • Tabs are missing.
  • Embedded images are missing.
  • And evtl. other things I did not notice.

Failure Information

Same result with both:

  • MS Office word 2010
  • Libre Office (Version: 5.1.6.2 Build-ID: 1:5.1.6rc2-0ubuntu1xenial6).

How to Reproduce

Please provide a code sample that reproduces the issue.

<?php
require __DIR__ . '/vendor/autoload.php';

use PhpOffice\PhpWord\Reader\Word2007 as Reader;
use PhpOffice\PhpWord\Writer\Word2007 as Writer;

$doc = (new Reader())->load('input.docx');
(new Writer($doc))->save('output.docx');

Context

  • PHP version: 7.2
  • PHPWord version: 0.16

All the suggested php extension are installed, even for features I do not used, just in case.

I have an example file I created with libre office writer, the version given above:
input.docx

update 1

You can test it with the code above, but this is how my output looks like:
output.docx

updated 2
It might be a reader problem. At least for comments, I realized that reading the input file, comments list is empty when accessed via phpword API. So obviously the writer does not write them.

@akomm
Copy link
Author

akomm commented Mar 25, 2019

I just checked the code and realized the reader does not support comments yet. Then checked again the feature page and realized there is "writers" header above it and another table for readers under it...

@akomm akomm closed this as completed Mar 25, 2019
@shaedrich
Copy link
Contributor

It might not be a bug per say, but since comments are supported in docx, I still would like to have that feature in phpWord sooner or later. Any update on this?

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

Successfully merging a pull request may close this issue.

2 participants