Archit Shrivastava

Archit Shrivastava

  • NA
  • 416
  • 117.4k

repeat background image in pdfdocument using itextsharp

Aug 30 2018 8:14 AM
i want to repeat backgroud image on my pdf document using itext sharp.
here my code to add image on document but i dont know how to repeat and set postion next to first image.
Document document = new Document(PageSize.A4, -240, 10, 10, 10);
PdfWriter writer = PdfWriter.GetInstance(document, new FileStream("test1.pdf", FileMode.Create));
document.Open();
iTextSharp.text.Image image = iTextSharp.text.Image.GetInstance(@"C:\Users\Archit\Downloads\icard2.jpg");
image.ScaleAbsolute(PageSize.A4.Rotate());
image.SetAbsolutePosition(0, 0);
document.Add(image);