Hello,
I add a stamp to each page with this code. But I want to add more than one stamp to each page.
How can I do it, I couldn't set up the foreach loop
private void damga(string resimdosyası, string dosyayolu)
{
byte[] bytes = File.ReadAllBytes(dosyayolu);
var resim = iTextSharp.text.Image.GetInstance(resimdosyası);
resim.SetAbsolutePosition(0, 100);
PdfContentByte waterMark;
using (MemoryStream stream = new MemoryStream())
{
PdfReader reader = new PdfReader(bytes);
using (PdfStamper stamper = new PdfStamper(reader, stream))
{
int sayfa = reader.NumberOfPages;
for (int i = 1; i <= sayfa; i++)
{
waterMark = stamper.GetUnderContent(i);
waterMark.AddImage(resim);
}
}
bytes = stream.ToArray();
}
File.WriteAllBytes(dosyayolu, bytes);
}