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

Changing the document leads to the document preview breaking in specialized software. #482

Open
SheinEA opened this issue Aug 28, 2024 · 4 comments

Comments

@SheinEA
Copy link

SheinEA commented Aug 28, 2024

I noticed that when working with a document, replacing text, adding paragraphs, etc., the document preview in specialized software does not work. If you open the document in MS Office, everything is fine. What could be the reason for this behavior?

@github-staff github-staff deleted a comment Aug 28, 2024
@SheinEA
Copy link
Author

SheinEA commented Sep 14, 2024

Hi, I did an analysis. You do not minify xml as in the original. This increases the file size, and in some solutions the preview breaks. It would be good if after working with the file its xml was restored to its original state.

@XceedBoucherS
Copy link
Collaborator

Hi,
Could you explain more in the minifying process ?
I mean, when we load a document, we read it's xml file and when we save, we write in the xml files, but there shouln't be anything increasing the xml file size other than new text.

Thank you

@SheinEA
Copy link
Author

SheinEA commented Oct 4, 2024

Hi!

  1. Create a new .docx document with the content - Hello!
  2. Make a copy of it for later comparison.
  3. Save one of these files using your library.
  4. Unzip the documents and find the files that have changed, for example the document.xml
  5. Compare the original version with the modified one, you will see something like this. Left is the original, right is after the changes:
    image
    To fix this, we had to get overhead:
image

@XceedBoucherS
Copy link
Collaborator

Hi,

From what I understand, the xml (in document.xml for example) do not look the same before and after using our library. The difference is the indentation added with our library, but the content is the same and using MS Office to open it is working great. The problem only occurs when using a third party software. You have found a workaround to remove the indentation by setting a Office2013 Format.

When we save the document, we are using the :
"public void Save( TextWriter textWriter, SaveOptions options )"
method from XDocument, where the options will be "SaveOptions.None", which means:
"Format (indent) the XML while serializing."

This has never been an issue for other customers, is easier to read and is a problem only for third party softwares (which need an old File Format ?). Since you have a workaround, we will take note of this issue and evaluate if a change would be beneficial for the community, but won't change anything at this point.

Thank you

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

No branches or pull requests

2 participants