I am facing an issue with GroupDocs where setUpdateFields is expected to update the Table of Contents (TOC) correctly in both DOCX and PDF outputs. However, the generated files contain discrepancies in some TOC page numbers.
While most headings display correct page numbers, a few entries are incorrect when compared to the actual document content.
I have attached the source document along with the generated DOCX and PDF files for reference and the code to generate these files.
Below are some examples of the mismatches observed:
- Main Title: Introduction to Rich Text Content — Actual: Page 6, TOC: Page 7
- Ordered List — Actual: Page 7, TOC: Page 8
- Static Hyperlink — Actual: Page 8, TOC: Page 9
- Standard Fonts — Actual: Page 21, TOC: Page 22
Can you please let us know if this is a bug and by when can this be fixed?
Steps to reproduce
- Copy the Groupdocs license under license folder with name as GroupDocs.Total.Java.lic
- Run below commands
i. mvn clean install
ii. docker build --platform linux/amd64 -t groupdocs-tocissue .
iii. docker run -m 9g --cpus=2 -p 8081:8080 groupdocs-tocissue
- Run below commands to copy fonts used and generate docx and pdf files
i. curl --location --request POST 'http://localhost:8081/api/conversion/copy-fonts?orgId=Org1'
ii. curl --location --request POST 'http://localhost:8081/api/conversion/toc?orgId=Org1&fileName=TocIssue'
In the docker container under files you can see two files generated with names TocIssue_updatedToc.docx and TocIssue_updatedToc.pdf. Please check the Toc in those files
TocIssue.docx (775.5 KB)
TocIssue_updatedToc.docx (735.6 KB)
TocIssue_updatedToc.pdf (985.1 KB)
TocIssue.zip (3.0 MB)
cc: @pankajgupta @amitdash
Hello @ravi1994 ,
Thank you for contacting us. We have logged your issue in our tracking system under the ID CONVERSIONJAVA-3114. As soon as our development team investigates it, we will share their feedback with you.
Hey @evgen.efimov Can you please let us know if there is any update on this ticket
Hello @ravi1994 ,
We apologize for the delay. According to our developers, they were able to reproduce the issue on their side and are currently continuing their investigation of this scenario. We will get back to you as soon as we have more updates from the development team.
Hi @evgen.efimov,
Thanks for letting us know, awaiting further updates on this
Hi @evgen.efimov
Is there any update on this issue and if it is confirmed as a bug when can we expect a fix for this?
Hello @ravi1994 ,
Unfortunately, there are no updates at the moment. I have just followed up with our development team, and they promised to clarify the situation regarding this issue in the near future.
Hello @ravi1994 ,
Could you please specify which version of GroupDocs.Conversion for Java you are using? Have you tried the latest 26.3 release?
According to our developers, they are unable to reproduce the issue with the latest version. Could you please verify this on your side and share your feedback?
Hi @evgen.efimov we are able to reproduce this with the latest version of Groupdocs Conversion 26.3. Please unzip file attached and change the version of Groupdocs in pom.xml to 26.3 and follow the same instructions given above. Following those steps we are able to reproduce this issue. Please let me know if you need any more info in reproducing the issue.
Hi @ravi1994 , I tested it with 26.3 and didn’t reproduce the issue. Let me check it in your attached project. I will update you.
Hi @ravi1994
I couldn’t reproduce it in Windows, but reproduced in a Docker container. It seems this is some kind of font substitution issue.
I will continue the investigation.