Hi,
I am using Aspose.Words 5.2.1, .net version. I have attached a Wordml document which has a few headings and sub headings in it. it also has track changes turned on. When I open this document using aspose.words and subsequently save it back as wordml it seems to lose some of the formatting infromation surrounding the headings. If you open the aspose.words saved version in Word, it thinks that there are a bunch of formatting changes.
The problem seems to be that the following WordML for each Heading from the original doc (the one attached here)
As you can see, the wx:wTabAfter attribute of the wx:t element is now set to 0 and the w:original attribute of the aml:annotation element is set to the final character of the initial value. In this case the initial value was “%1:1:0:.” and the aspose.Words saved value is only “.”
These changes make Word display unwanted track changes markers. I need to be able to generate a “clean” document with headings, i.e. have aspose export the heading WordML verbatim instead of making these changes.
Thanks,
Stu
Hi
Thanks for your inquiry. Both documents (before processing using Aspose.Words and after) look the same in MS Word. The matter is that xml elements with “wx” prefix is not needed. These elements have a supplemental XML information added in 2003 that serves as “hints” for transformation of a Word document to HTML format; for example, font, color, border, and absolute positioning information.
After open/save the document using MS Word this information will be added to the document again.
Regarding “w:original” I should say that I got the same result before and after processing document using Aspose.Words.
Before:
Hi Alexey,
I have attached my output document which is saved with aspose.words 5.2.0. Take a look at the w:original value for each heading, it is only the last character of the initial value. Also, if you open this doc in Word you will see Word shows each heading as having a formatting change.
Thanks,
Stu
Hi
Thank you for additional information. But it seems that the attached document is not output of Aspose.Words. Aspose.Words add the following comment in the output XML
And your document does not have this comment.
Please see the attached documents. These documents were generated by Aspose.Words 5.2.0 and 5.2.1 and both have no track changes markers.
Could you please show me your code?
Best regards.
Hi Alexey,
I apologise, I am atcually saving as
Aspose.Words.SaveFormat.Doc. If you save the input file I provided as Doc you will see the track changes markings in Word.
I had then subsequently saved the doc in Word as xml to compare the two.
I did try saving as WordML using aspose and you’re right, the w:original attributes are the same. My problem is that I need to return a backwards compatible .doc file, not a WordML file.
Thanks,
Stu
Hi
Thank you for additional information. I managed to reproduce this problem on my side. I created new issue #5583 in our defect database. We will notify you as soon as it is fixed.
As a workaround you can call AcceptAllRevisions before saving. Please see the following code example:
// Open document
Document doc = new Document(@"Test309\input.xml");
// Accept all revisions in the document
doc.AcceptAllRevisions();
// Save document
doc.Save(@"Test309\out.doc");
Hi Alexey,
Thanks for the help, I tried the workaround and it works. I also previously identfied a problem opening a file with asian fonts in it, which you identified as defect #5506. Can you give me any update on the status of that defect?
thanks,
Stu
Hi
Thanks for your inquiry. Issue #5506 is already fixed in current code base. Release will be published within 1-2 weeks. I will notify you.
Best regards.
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.