TOC font styling all over the place

Hi ,

I am having issues with the fontstyling and size when i’m inserting a table of contents .
I am building the table of contents in de the following way :

  1. Create main document
  2. Create TOC document loading it from a dotx file (wich has defined styling)
  3. append toc doc to main doc
  4. append further pages
  5. updatefields and update pagelayout
  6. Save doc to pdf

The result is that the TOC takes over the exact styles from the headers wicht results in a TOC with fontsize 20. Wich is not defined in the dotx template. How do i solve this problem i already tried the following method.

private Document updateTableOfContents(Document doc)
{
    DocumentBuilder db = new DocumentBuilder(doc);
    doc.Styles[StyleIdentifier.Toc2].Font.Bold = true;
    doc.Styles[StyleIdentifier.Toc2].Font.Size = 10;
    doc.Styles[StyleIdentifier.Toc2].Font.Name = "Arial Narrow";
    doc.Styles[StyleIdentifier.Toc1].Font.Size = 12;
    doc.Styles[StyleIdentifier.Toc1].Font.Name = "Arial Narrow";
    doc.Styles[StyleIdentifier.Toc1].Font.Bold = true;

    db.Document.UpdateFields();
    db.Document.UpdatePageLayout();
    return doc;
}

Greetings ,
Eric

Hi
Thanks for your request. I cannot reproduce the problem on my side using the latest version of Aspose.Words (9.3.0). You can download this version from here:
https://releases.aspose.com/words/net
Also could you please create simple application which will allow me to reproduce the problem on my side? I will check it and provide you more information.
Best regards,

Hi ,

I’ve reduced the application to a simple and an used the aspose 9.3.0 dll .
The problem still occurs , hopefully u can reproduce the problem with the simpel application.

Best regards ,
Eric

Hi Eric,

Thank you for additional information. 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 fixed.
Best regards,

Hi andrey ,

I’m glad that you could reproduce the issue , hopefully i wil be fixed soon .
I have a few questions relating this issue :

  1. Is there any way to track this issue, so i can get an estimate time when it wil be fixed?

  2. I was wondering if there’s any possibillity to implent a TOC solution with correct styling? Because we do have a deadline to keep with our customers.

3.If we upgrade to a priorty support package , will this issue be fixed sooner ?

Many thanks for your support already ,

greetings ,
Eric

Hi Eric

Thanks for your inquiry.

  1. Currently I cannot provide you any reliable estimate regarding this issue. We will be sure to inform you in this thread of any developments regarding this issue.
  2. I little bit modified your template document and now the TOC looks fine. I send the modified document to your e-mail.
  3. The priority of issues with “Priority Support” mark is automatically increased.

Best regards,

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

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