title: Insert images in multiple pages in pdf
body: <p>Is it is possible to change the following code in order to create the images in the beginning and use their references in the pages in which I want to insert the specific image?</p>
  
  <pre><code>using (Stream inputPdfStream  = new FileStream("sample.pdf", FileMode.Open, 
                                                 FileAccess.Read, FileShare.Read))
  using (Stream outputPdfStream = new FileStream("result.pdf", FileMode.Create, 
                                                 FileAccess.Write, FileShare.None))
  {
      var reader = new PdfReader(inputPdfStream);
      var stamper = new PdfStamper(reader, outputPdfStream);
      PdfContentByte pdfContentByte = null;
  
      int c = reader.NumberOfPages;
      string fnmae = "";
      iTextSharp.text.Image image = null;
  
      for (int i = 1; i &lt;= c; i++)
      {
          fnmae = (i % 2==0) ? "1.jpg" : "6.jpg";
          image = iTextSharp.text.Image.GetInstance(fnmae);
          pdfContentByte = stamper.GetOverContent(i);
          image.ScaleToFit(100, 100);
          image.SetAbsolutePosition(100, 100);
          pdfContentByte.AddImage(image);
      }
  
      stamper.Close();
  }
  </code></pre>