Getting issue while adding Watermark to PDF

We are unable to add Watermark on Pdf for more then 150 pages
and we are using Aspose.pdf latest version (22.11.0)
and below is the code snippet

PdfFileInfo info = new PdfFileInfo(TempFilePath);
TextStamp textStamp = new TextStamp(Watermark);
textStamp.YIndent = 30;
textStamp.Width = 140;
textStamp.Height = 30;
textStamp.TextState.Font = FontRepository.FindFont(“Arial”);
textStamp.TextState.FontSize = 75.0F;
textStamp.TextState.FontStyle = FontStyles.Italic;
textStamp.TextState.ForegroundColor = Aspose.Pdf.Color.FromRgb(System.Drawing.Color.LightSlateGray);
textStamp.Opacity = 0.3;
textStamp.RotateAngle = 0;
textStamp.setStampId(123);
for (var i = 1; i <= totalpagecount; i++)
{
log.getLogs(“InFor:”+i + istrGuid, w);
var page = pdfDocument.Pages[i];
var x = info.GetPageWidth(i);
textStamp.XIndent = x - 200;
page.AddStamp(textStamp);

                                            //pdfDocument.Pages[i].AddStamp(textStamp);
                                            pdfDocument.Save(TempFilePath);
                                        }

@Shubham.Ambekar

To ensure a timely and accurate response, please attach the following resources here for testing:

  • Your input file.
  • Please attach the output file that shows the undesired behavior.
  • Please attach the expected output file that shows the desired 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.