title: How can I add Header and footer in pdf using iText in java?
body: <p>I am trying to add Header and footer in my pdf(iText).
   For this I have created one servlet and I also created one class HeaderandFooter that extends PdfPageEventHelper.  </p>
  
  <pre><code>public class HeaderAndFooter extends PdfPageEventHelper {
      public HeaderAndFooter(String name) {
          super();
      }
  
      @Override
      public void onEndPage(PdfWriter writer, Document document) {
          super.onEndPage(writer, document);
          //code
  
      }
      @Override
      public void onStartPage(PdfWriter writer, Document document) {
          super.onStartPage(writer, document);
                  //code
  
      }
  }
  </code></pre>
  
  <p>But I dont know what should I write in a method so that It will display heading any text and in footer page no.</p>