Question on Styles

Good Morning,

i have a question on Styles. I want to work with a RTF based File which has mainly Tables. Sometimes Text in the Table is formatted as Headline. This was not a Word generated RTF, just as a note.
In Word the Format is displayed. Anyway with Aspose i want to iterate over the document (best over the headline-level Formattings directly) to find all Headlines and do stuff with it.
My ParagraphFormat in the corresponding Cell stays “normal”…
Is there a way to get the “Headline …” correctly?

Best Regards

Hi Robert,


Thanks for your inquiry. Please note that Aspose.Words mimics the same behavior as MS Word does. If you open your RTF in MS Word and get the Heading style for a Paragraph, Aspose.Words will return the same style for that Paragraph.

It would be great if you please share
your input RTF document here for investigation purposes. I will
investigate the issue on my side and provide you more information.

Formatting is applied on a few different levels. For example,
let’s consider formatting of simple text. Text in documents is
represented by Run element and a Run can only be a child of a Paragraph.
You can apply formatting 1) to Run nodes by using Character Styles
e.g. a Glyph Style, 2) to the parent of those Run nodes i.e. a Paragraph node (possibly via paragraph Styles) and 3) you can also apply direct formatting to Run nodes by using Run attributes (Font). In this case the Run will inherit formatting of Paragraph Style, a Glyph Style and then direct formatting.

Hi Tahir,

thanks for your reply. I attached an RTF as I would want to use it with aspose. When I open it in Doc-Explorer for example and check the Style on the Paragraph that contains “Demographics”, I see normal with no Headline. In Word I can see the “Heading …” Style.

Best regards and thanks a lot
Robert

Hi Robert,

Thanks for sharing the detail. I
have tested the scenario and have managed to reproduce the same issue
at my side. For the sake of correction, I have logged this problem in
our issue tracking system as WORDSNET-9531. I have linked this forum thread to the same issue and you will be notified via this forum thread once this issue is resolved.

We apologize for your inconvenience.

Thanks a lot Tahir,

Just a question at site, i’m using Aspose for Java, the Ticket ist WORDSNET…
Looking forward to see, what the solution will be :wink:

Hi Robert,


Thanks for your inquiry.

Please
note that the latest version of Aspose.Words for Java is completely
auto-ported from .NET, i.e. we do not write code for Aspose.Words for
Java; it is generated out automatically from C# code of Aspose.Words for
.NET. I managed to reproduce this issue in Aspose.Words for .NET. You will get the fix in Aspose.Words for Java.


Hi Tahir,

do you have any news on the style topic already? I figured out, that saving the RTF in Word and then use it in Aspose is sufficient, to get the style displayed. However we can’t do this step for the production environment … this was only for testing.

best regards
Robert

Hi Robert,

Thanks for your inquiry.

I am afraid your issue has now been postponed till a later date due to some other important issues and new features. We will inform you as soon as there are any further developments.

We apologize for your inconvenience.

Thank you very much Tahir for the info,


at the moment I’m working on a PoC for having Aspose.Words as base for a new Version of a tool we are using. If I can provide you any further Info on this Issue or for testing purpose just let me know :slight_smile:

Robert

Hi Robert,


This issue happens because source document breaks the rules of RTF Specification but MS Word have no problems with it. This is a missing feature in Aspose.Words. We will update you via this forum thread once this feature is available.

If we need any further information from your side, we will surely request from you. Thanks for your cooperation in advance.

Hi There,
is already clear, whether this issue will be fixed in future version of Aspose.Words? would be good to have it somewhen, as we are currently working around with an adapted way of parsing the rtf File, which is a bit uncomfortable to use :slight_smile:

cheers Rob

@tmdolphin

Thanks for your inquiry. We regret to share with you that your issue has been postponed. I am afraid, there is no estimate available at the moment. We will inform you via this forum thread as soon as there are any further developments. We apologize for your inconvenience.