Below is the C# code which is taking longer time to execute
public void CreatePDFFile()
{
try
{
var logger = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
…... Optimise Page‑Number Replacement You use FindReplaceOptions...it faster by: Running the replace once on the whole document...