title: how to add a table to a page with header and footer using itext 7
body: <p>i need to add a table in a specific position and be repeated in all pdf pages without interference with header and footer 
  this is my code </p>
  
  <pre><code>PdfEventHandler handler = new PdfEventHandler(header, x,y);
  pdf.addEventHandler(PdfDocumentEvent.START_PAGE, handler);
  Table table = new Table(getcolumnsWidth(pdfColumns, tableWidth));
  String line = br.readLine();
  process(table, line, true);
  while ((line = br.readLine()) != null) {
      process(table, line, false);
  }
  br.close();
  document.add(table);
  </code></pre>
  
  <p>with</p>
  
  <pre><code>public class PdfEventHandler implements IEventHandler {
  
      private String header;
      private int x,y;
  
      public PdfEventHandler(String header,int x , int y) {
       this.header =header;
       this.x = x; this.y =y;
      }
  
      @Override
      public void handleEvent(Event event) {
          PdfDocumentEvent docEvent = (PdfDocumentEvent) event;
          PdfDocument pdfDoc = docEvent.getDocument();
          PdfPage page = docEvent.getPage();
          PdfCanvas pdfCanvas = new PdfCanvas(page.newContentStreamBefore(), page.getResources(), pdfDoc);
          Rectangle area = page.getPageSize();
          int pageHeight = (int) area.getHeight();
          Canvas canvas = new Canvas(pdfCanvas, pdfDoc, area);
  
          canvas.showTextAligned(header, x, y, TextAlignment.CENTER);
      }
  }
  </code></pre>
  
  <p>this is the result pdf file 
  <a href="https://i.stack.imgur.com/ZzehG.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ZzehG.png" alt="enter image description here"></a></p>