Hello,
It seems that there’s a bug in the RTF -> DOCX conversion whereby style names don’t go across correctly. Try the following:
1. Create an RTF document that has “Heading 1” and “Heading 2” paragraph styles applied to some of the text.
2. Open the RTF file in Word and open Word’s styles panel to view the styles associated with the text as you click into the heading paragraphs.
3. Now convert the RTF file to .doc format using Aspose.Words and again open it in Word and examine the styles using the styles panel.
4. Now convert the RTF file to .docx format using Aspose.Words and once again open it in Word and examine the styles.
In (2) and (3) - when the RTF file is opened in Word or when the .doc file generated from Aspose is opened in Word - “Heading 1” and “Heading 2” appear exactly as expected.
In (4), however - when the .docx file generated from Aspose is opened in Word - “Heading 1” and “Heading 2” become “Heading 11” and “Heading 21”. That is, a “1” is appended to the style names. Word’s default “Heading 1” and “Heading 2” styles are maintained, rather than being overwritten by the style definitions in the RTF file.
(This was all tested in Microsoft Word 2011 for Mac using the latest build of Aspose.Words for Java.)
This is highly confusing behaviour - the style names in the RTF file should be maintained when the file is converted to .docx format rather than having a “1” suffix appended to them. Word’s default styles should not take precedence over the ones contained in the RTF document.
I hope this can be fixed in an upcoming update.
Many thanks,
Keith
Hi Keith,
Great, thank you. (And thank you for fixing the other bugs I reported - I didn’t get around to saying thank you after receiving the notifications that they’d been fixed.)
All the best,
Keith
Hi Keith,
Hi,
Thanks for looking at this. I’m afraid I’m still seeing the bug, however, even in 15.6.0. Please try converting the attached RTF file to .docx format using Aspose.Words for Java 15.6.0. Also try converting it to .doc format.
Results:
1. If you open the attached RTF file in Word, the bold paragraphs containing the text “Heading 1” and “Heading 2” are correctly identified as having paragraph styles called “Heading 1” and “Heading 2” in Word’s styles panel.
2. If you convert the attached RTF file to .doc format and open that in Word, again, the paragraph styles have the correct names: “Heading 1” and “Heading 2”.
3. If you convert the attached RTF file to .docx format, however, and open that in Word, the paragraph styles are called “Heading 11” and “Heading 21”.
So, the RTF file works fine and the .doc format is working as expected, but something is going wrong in the .docx format whereby it is renaming the styles, appending a “1” to the end of the style names in the case of heading styles.
Thanks and all the best,
Keith
The issues you have found earlier (filed as WORDSNET-12089) have been fixed in this .NET update and this Java update.
This message was posted using Notification2Forum from Downloads module by aspose.notifier.
Many thanks! Downloading now to test it.
All the best,
Keith