title: Using PdfStamper to add a rectangle
body: <p>Hi I have a pdf I created using itextsharp. </p>
  
  <p>Using pdfreader I am reading the created pdf into a pdfstamper. </p>
  
  <p>Now I am trying to use the pdfstamper to add a black rectangle the size of the page on all pages. How do i do this? </p>
  
  <p>Also I cannot use document to add the rectangle because the stream is close!</p>
  
  <pre><code>    MemoryStream stream = new MemoryStream();
  
      PdfReader pdfReader = new PdfReader(output.ToArray());
      PdfStamper stamper = new PdfStamper(pdfReader, stream);
  
      for (int x = 0; x &lt; stamper.Reader.NumberOfPages; x++)
      {
          Rectangle rectangle = document.PageSize;
          rectangle.BackgroundColor = new BaseColor(0, 0, 0);
          //stamper.Writer.AcroForm.
          //document.Add(rectangle);
      }
  
      output.Close();
      pdfReader.Close();
      stamper.Close();
  </code></pre>