Hi @tahir.manzoor, I have read your answers related to timeout issues. I am processing huge amount of files and I have to do Update Fields for each file. I implemented timeout using Interruption token, but since it is deprecated, can you please help me in achieving the same functionality using IPageLayoutCallback.
In your case, you need to use IPageLayoutCallback interface. Could you please share the issue detail that you are facing by implementing this interface and not with InterruptionToken class?
When using pagecallback, doing updatepagelayout after updatefields is giving me exception. I believe it is because updatefields is not completed properly.
Is there a way to check if update fields is complete or not? I am implementing a bulk transaction , so I would like to know which files are in proper alignment.
Do you know why some word documents have “?” Instead of page numbers in table of contents. I have been working on this issue for past several days with no proper answer to this question.
This is the issue I get when calling updatepagelayout after updating fields using page callback. There are no inner exception or message, it just goes to catch block.
You are facing the expected behavior of Aspose.Words. If you interrupt these methods, the exception may occur.
Please attach the following resources here for testing:
Your input Word document.
Please share your expected output/behavior.
Please create a standalone console application (source code without compilation errors) that helps us to reproduce your problem on our end and attach it here for testing.
As soon as you get these pieces of information ready, we will start investigation into your issue and provide you more information. Thanks for your cooperation.
PS: To attach these resources, please zip and upload them.
I have attached sample project and input file to test the functionality. I have commented code for updatepagelayout as well as updating TOC using Interruption token. Please let me know if you have problem updating nuget packages.
As you can see in output file, instead of page numbers , “?” is coming. And I cant call updatepagelayout method because it will give an error.
As already mentioned, we are doing bulk import of files, if we dont use Ipagelayoutcallback or limit the time each file gets to update Table of Content, we cannot complete the import process successfully.
Unfortunately, we are unable to compile your shared project. Please check the attached image. image.png (83.2 KB)
Please create a standalone console application (source code without compilation errors) that helps us to reproduce your problem on our end and attach it here for testing.
Could you please share the problematic output document also?
Yes, we will test your code with valid license of Aspose.Words. Please share the simplified code example to reproduce the same issue. Thanks for your cooperation.
We have investigated your issue and noticed that the output document is expected. The code interrupted the Document.UpdateFields method. So, the page numbers are not updated.
The PDF file is not save because the IPageLayoutCallback.Notify method is called and your code throws an exception.
Please note that when update field process or updating page layout is interrupted the output may not be correct.