Thanks for sharing sample project.
We have checked your project and noticed that you are using expression ($p of $P) to display page numbers. Since you cannot use ProcessParagraphs() method due to performance overhead, You may probably try using different approach (probably workaround) to add page numbers. For an instance, you can change your call to AddHeader() method in OnPageGenerate() method as following:
AddHeader(metaInfo, page, page.Number - 1, sectionId, isCoverPage, sectionHeaderHtml, (showSectionPageNumbers ?? false), lstElementEntity, lstElementPropertyEntity, lstStepEntity, generatedFiles, isChangeLog, coverChangeLog);
AND at the line number “599”, you can change the statement as following:
TextFragment hfHeaderTxt2 = new TextFragment("Page " + pageNumber + " of $P");
With the above-mentioned changes, the attached PDF has been generated in our environment. You may further modify your code as well according to your actual needs. Please share your feedback in case our suggestions do not suit your requirements.
JohnMcClane_The Die Hard Films (1988-2013)_5248857363648552693.pdf (115.8 KB)