Hi
I try to add a stamp to each page But I cannot see the stamp in all pages with a PDF that contains both portrait and landscape format. I can see the stamp only on the first page. It seems that the origin is according to the first page only !
This is my code. Thanks a lot for your help !
private bool StampFile(string inFile, string outFile)
{
PdfFileInfo fileInfo = new PdfFileInfo (inFile);
int count = fileInfo.NumberofPages;
PdfFileStamp fileStamp = new PdfFileStamp (inFile, outFile);
for (int i = 1; i <= count; i++)
{
FormattedText ft = new FormattedText ("hello world !")
Stamp logoStamp = new Stamp ();
logoStamp.BindLogo (ft);
logoStamp.Rotation = 0;
logoStamp.Opacity = 1f;
logoStamp.Pages = new int[] { i };
logoStamp.SetOrigin ((fileInfo.GetPageWidth (i) - ft.TextWidth) / 2, fileInfo.GetPageHeight(i) - 50);
fileStamp.AddStamp (logoStamp);
}
fileStamp.Close ();
return true;
}
This message was posted using Page2Forum from Adding watermarks on different sized pages in a PDF - Aspose.Pdf.Kit for .NET and Java