UpdateDocumentFields takes a long time

Hello,

I have a large document (about 65 pages) with many sections and tables. Calling the UpdateDocumentFields call in order to have a correct Table Of Contents takes a very long time. Are there any possible tips and tricks to optimize this


9 Replies

DS Dharanya Sakthivel Syncfusion Team November 5, 2024 01:05 PM UTC

Hi Natalie,

Based on the given details, we suspect that you may have called both UpdateDocumentFields() to update fields and UpdateTableOfContents() to update the table of contents. During these updates, internally the Word-to-PDF layout engine is used to update the page numbers in the Word document, which can take some time.

If you feel that the document update is taking too long, please share the following details:

  1. The input document used on your end
  2. The complete code snippet
  3. The time taken for the update

With this information, we will check the possibility of reducing the time required for the updating TOC.

Regards,
Dharanya.



NW Natalie Westphal November 5, 2024 06:05 PM UTC

Is it possible to get the page numbers of a section from syncfusion docio word document without converting to pdf? That way I could manually create the TOC rather than using the built in one. 



NW Natalie Westphal November 5, 2024 11:44 PM UTC

Additionally, I have responded to the email for this support ticket from forum-support@syncfusion.com with a sample code project. Can you confirm that you received this via that email? Thanks. 



DS Dharanya Sakthivel Syncfusion Team November 6, 2024 12:48 PM UTC

Natalie,

Regarding “Is it possible to get the page numbers of a section from syncfusion docio word document without converting to pdf? That way I could manually create the TOC rather than using the built in one“:
The Word document is a flow document in which contents (paragraphs, tables, etc.,) will not be preserved page by page; instead, the contents will be preserved sequentially section by section. Word viewer/editor renders the contents of the Word document page by page dynamically when opened for viewing or editing. This page wise rendered information will not be preserved in the file level. DocIO is a non-UI component that provides a full-fledged document instance model based on the file level information of Word document. Therefore, it is not feasible to get the section page number from a Word document using DocIO.

Regarding “Additionally, I have responded to the email for this support ticket from forum-support@syncfusion.com with a sample code project. Can you confirm that you received this via that email? “:
We haven’t received the mail you sent. Could you please check if it was sent to the correct address?

Regards,
Dharanya.




NW Natalie Westphal November 8, 2024 05:35 PM UTC

Yes, I sent it to  forum-support@syncfusion.com ​which is the same email address that the ticket responses are coming from. I sent it on Tuesday at 3:41pm PST.  Is that the correct address to send it to? 



DS Dharanya Sakthivel Syncfusion Team November 11, 2024 02:49 PM UTC

Natalie,

We have received and reviewed your sample. After generating the document contains 62-pages, we observed that updating it takes approximately 14 seconds. Please see the screenshot below for reference.



We have reproduced the reported problem “UpdateDocumentFields and UpdatetableOfContent takes a long time when updating a document” in our end. We will validate this issue and update more details within 2 days.

Regards,
Dharanya.




DA Dharanitharan Ayyasamy Syncfusion Team November 13, 2024 03:49 PM UTC

Natalia, still we are validating the reported problem in our end. We will update more details within 2 days.



DS Dharanya Sakthivel Syncfusion Team November 15, 2024 05:07 PM UTC

Natalie,

We have found that the UpdateTableOfContents() function takes approximately 14 seconds to execute. As we mentioned earlier, while calling UpdateTableOfContents(), we are internally processing our Word-to-PDF layout engine to update the page numbers in the Word document.

Upon initial investigation, the generated document contains nearly 130 tables and 62 pages. It takes a considerable amount of time to layout these tables and pages using our Word-to-PDF layout engine.

However, we are evaluating the feasibility of further reducing this time and will share further details next week.

Regards,
Dharanya.




DS Dharanya Sakthivel Syncfusion Team November 21, 2024 05:05 PM UTC

Natalie, as we mentioned in the previous update, when calling the UpdateTableOfContents() function, we are internally processing our Word-to-PDF layout engine to update the page numbers in the Word document.

The generated document contains a large number of tables (more than 130). While invoking the Word-to-PDF layout engine, we iterate through each row of the tables, as well as their cells, content, and formatting from the DOM, layout them one by one. This is the architecture of our Word-to-PDF table layout process. This is the considerable time to layout that number of tables in the Word-to-PDF layout engine.

Regards,
Dharanya.


Loader.
Up arrow icon