Spire.Doc is a professional Word .NET library specifically designed for developers to create, read, write, convert and print Word document files. Get free and professional technical support for Spire.Doc for .NET, Java, Android, C++, Python.

Thu Jan 24, 2019 9:13 am

We encounter issues for page references in TOC - we tried to figure out which part of the document is causing the problem but we couldn't solve it.

The document is built with MS Word doc used as template. After composing the document with the TOC; page numbers shows in the TOC do not align with real page numbers. If we update the TOC field using MS Word (right-click on TOC, select update field, only page numbers), after that we tried to get the output in C#, again the page numbers are irrelevant in the TOC.

We are using the TOC as like below format.

TABLE OF CONTENTS
SCOPE OF WORK 6
AREA DATA 8
SITE DATA 11
IMPROVEMENT DATA 15
CONDITIONS 17
QUALITY 25


Note : Few Page numbers are correct and few are not correct.

we have used the "document.UpdateTableOfContents()" in C# code. Can you please suggest if anything we missed to add in the C# or template side.
Last edited by Pathfinder on Fri Jan 25, 2019 6:44 am, edited 1 time in total.

Pathfinder
 
Posts: 7
Joined: Mon Nov 19, 2018 5:08 am

Thu Jan 24, 2019 9:48 am

Hi,

Thanks for your inquiry.
According to your information, it seems your issue is same as the issue in this post. Are you from the same company? If so, the issue has been submitted to our Dev team. We will let you know once there is any update.
If not or the input file and the code you were using are not the same, to help us investigate your issue accurately, please share them.

Sincerely,
Betsy
E-iceblue support team
User avatar

Betsy.jiang
 
Posts: 3099
Joined: Tue Sep 06, 2016 8:30 am

Fri Jan 25, 2019 6:43 am

Hi,

Yes i'm from pathfinder company. we just go through your post,
Code: Select all
https://www.e-iceblue.com/forum/toc-for-table-with-header-repeated-t7944.html
which seems like the same issue but we are facing only the TOC page number issue. TOC page numbers are correct for first 4 contents and rest of the page numbers are not correct in the TOC content. We are using the spire License Version(6.7.14.40040) in the application.

Template Side:
Customized the TOC in the template(i.e MS-Word Doc) , not in the Code

C# Code Side:
Added only this code "document.UpdateTableOfContents()" in the application.

If anything we missed to add in the template or code side, please suggest us.

Attached the template with TOC format (Template_TOC.png)

Pathfinder
 
Posts: 7
Joined: Mon Nov 19, 2018 5:08 am

Fri Jan 25, 2019 7:43 am

Hi Pathfinder,

Thanks for your information.
At present, the latest standard version is Spire.Doc for.Net standard Edition:7.1 which has more fixes than old one. I suggest you try to use this version firstly. Since each document has unique structure, if the issue still happens, please provide your input document and the entire code you were using for testing and further investigation.
You could upload it here or send to Betsy.jiang@e-iceblue.com via email.

Sincerely,
Betsy
E-iceblue support team
Last edited by Betsy.jiang on Tue Jan 29, 2019 9:04 am, edited 1 time in total.
User avatar

Betsy.jiang
 
Posts: 3099
Joined: Tue Sep 06, 2016 8:30 am

Tue Jan 29, 2019 9:02 am

Hi Pathfinder,

Hope you are doing well.
As for your issue, did you try the latest version? If the issue still exists, please provide your input document and the entire code you were using for testing and further investigation.

Sincerely,
Betsy
E-iceblue support team
User avatar

Betsy.jiang
 
Posts: 3099
Joined: Tue Sep 06, 2016 8:30 am

Wed Jan 30, 2019 1:03 pm

Hi ,

We have tried with the latest standard version "Spire.Doc for.Net standard Edition:7.1", which is not working for us.

We are facing the same issue as like below link,

Code: Select all
https://www.e-iceblue.com/forum/update-index-content-component-t4719.html

Note :
We have tried with document.IsUpdateFields = true and document.UpdateTableOfContents() , but it doesn't work.

Pathfinder
 
Posts: 7
Joined: Mon Nov 19, 2018 5:08 am

Thu Jan 31, 2019 2:15 am

Hi Pathfinder,

Thanks for your information.
As for the issue, please provide your input file and full code for testing and further investigation.

Sincerely,
Betsy
E-iceblue support team
User avatar

Betsy.jiang
 
Posts: 3099
Joined: Tue Sep 06, 2016 8:30 am

Return to Spire.Doc