Missing support for \tc fields in an RTF file

I’ve noticed that Aspose.Words does not seem to support table of contents entries in RTF format (specified as \tc)

It does seem to be supported if Aspose loads from a .doc file. Attached is a sample .rtf file. Below is the code. If you open up the resulting word document, you will notice that the \tc entries have been stripped. If you update the table of contents, nothing will show up.

void Test()
{
    // set the license…

    // load the rtf document
    Document doc = new Document(@"c:\TCEntryTest.rtf");

    // save the file as a .doc
    doc.Save(@"c:\TCEntryTest.doc", SaveFormat.Doc);
}

For what its worth, here is the relevant documentation from the RTF1 spec:

TABLE OF CONTENTS ENTRIES
=========================

The table of contents entry group begins with the control word \tc. It is followed by the text of the table of contents entry and other optional control words that further define the group.

As with index entries, text that is not formatted as hidden with the \v character-formatting control word is put into the document. The following control words can also be used in this group:

Control Word Meaning
------------ -------

\tcf The type of table being compiled; is mapped
by existing Microsoft software to a letter
between A and Z (the default is 67, which maps to
C and is used for tables of contents).

\tcl The level number (the default is 1).

Hi
Thanks for your request. I managed to reproduce the problem and created new issue #7076 in our defect database. I will notify you as soon as it is fixed.
Best regards.

I am demoing Aspose.Words for purchase by our company, however we need to be able to support the \tc fields.

Using the latest demo version, this problem still exists.

Is there a fix for this?

Thanks.

Hi

Thanks for your request. Unfortunately, the issue is still unresolved. I added your request into my monthly report, this will push the issue up in the priority list. We will let you know once the issue is resolved. My apologizes for inconvenience.
Best regards.

Any idea on the timeframe? We are looking to go live at the end of August.

Thanks,
Lee

Hi

Thanks for your inquiry. Currently, I cannot promise you any exact date. We will try to resolve the problem in one of the upcoming releases.
Best regards.

Alexey,

Just checking to see if you have any more info on this.

Thanks,
Lee

Hi

Thanks for your inquiry. The issue is already resolved in the current codebase. The fix will be included into the next version of Aspose.Words, which comes out in a week or so. We will notify you.
Best regards.

The issues you have found earlier (filed as 7076) have been fixed in this update.

This message was posted using Notification2Forum from Downloads module by aspose.notifier.
(23)

There is still an issue with the TOC in RTF files.

The issue seems to be with the \v tag that preceded the \tc tags.
When this \v is present, the heading text does not show up in the TOC.

When the \v is removed, the heading text shows up in the TOC, but the heading text in the paragraph is duplicated.

It looks like the \v is suppressing the heading text in the TOC when it should not be.

I am attaching 2 files to show this issue.

The first file is a RTF file that has a TOC. I have removed the \v from 2 of the TOC entries.

You can see that the heading text shows up for only these 2 entries, however the text in the paragraph is doubled.

The second is the output file.

This was generated via the following code snippet:

string fname = @"c:\2006_2006spd";
System.IO.Stream stream = System.IO.File.OpenRead(fname + ".rtf");
Document doc = new Document(stream);
stream.Close();
doc.UpdateTableLayout();
doc.UpdateListLabels();
doc.UpdateFields();
doc.UpdatePageLayout();

doc.Save(fname + ".pdf");

Hi

Thank you for reporting this problem to us. I managed to reproduce the problem on my side. Your request has been linked to the appropriate issue. You will be notified as soon as it is resolved.
Also, as I can see the problem occurs only upon rendering. If save the output document in DOC TOC looks fine.
Best regards,

I tried to save in doc format and it was still corrupted.
Could you send me a code example?

Also, if we decide to purchase (the priority support) with the understanding that this will be corrected, will this be considered a minor issue that could be quickly fixed?

Hi

Thanks for your inquiry. I used the following code:

Document doc = new Document(@"Test001\2006_2006spd.rtf");
doc.UpdateFields();
doc.UpdatePageLayout();
doc.Save(@"Test001\out.doc");

I see that if update TOC again in the output document using MS Word, TOC looks improperly. I added this information to the defect description.
Best regards,

If we decide to purchase (the priority support) with the understanding
that this will be corrected, will this be considered a minor issue that
could be quickly fixed? If so, what is the timeline?

Hi

Thanks for your inquiry. Unfortunately, it is difficult to tell you how complex the issue is and how long it will take to fix the problem. I raised the priority of this issue. We will let you know once there is some progress with this issue.
Best regards,

The issues you have found earlier (filed as 18776) have been fixed in this .NET update and in this Java update.

This message was posted using Notification2Forum from Downloads module by aspose.notifier.