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);
}