Hi,
Recently, I update my aspose.words to the latest version v25.2.0. I found the performance degrade sharply for updating fields and converting docx into PDF. At the same time, i checked other versions and found this issue starts from v24.12.0.
Thanks
BR
@spaceChang Could you please attach the input document where the performance degradation is observed? We will review the issue and provide you with more information.
Hi @alexey.noskov
I checked the file you want with my security infra. it’s a pity i cannot upload it to any website. I can illustrate the document i am using. it contains about 18 chapters and 800 pages. Based on my debug result, I found this degradation mainly occurs in updating field and saving docx into pdf. In my codes, I used Document.update_fields()
evidently to update the TOC and the codes you ever suggested to generate pdf from docx. As my understanding, pdf generation may also trigger updating field. So I think this issue may be mainly caused by updating field. My codes are as follows:
- Update TOC
doc = aw.Document(outFile)
doc.update_fields()
doc.save(outFile)
- Convert docx into pdf
pdfFile = os.path.abspath(os.path.join(outputPath, outputFilename + '.pdf'))
save_options = aw.saving.PdfSaveOptions()
save_options.page_mode = aw.saving.PdfPageMode.USE_OUTLINES
save_options.outline_options.headings_outline_levels = 9
doc = aw.Document(outFile)
doc.save(pdfFile, save_options)
Sorry that I cannot provide the related data for you and you can make some fake data to mainly check the API of Document.update_fields()
by comparing to the previous version , you may see the case.
OS: redhat7.9
Python: 3.9.12
Thanks
@spaceChang Unfortunately, without the problematic document, it is difficult to determine the cause of the performance degradation on your side. In our tests before the release, we did not observe any performance issues. The problem is likely specific to your document. Have you tried reproducing the problem with dummy document on your side?