code: public void setAlignment(int alignment) {
          super.setAlignment(alignment);
          for(int i = 0; i < this.content.length; i++) {
              if(this.content[i] instanceof Paragraph) {
                  ((Paragraph) this.content[i]).setAlignment(alignment);
              } else if(this.content[i] instanceof Table) {
                  ((Table) this.content[i]).setAlignment(alignment);
              } else if(this.content[i] instanceof Image) {
                  ((Image) this.content[i]).setAlignment(alignment);
              }     
          }
      }
docs: Set the alignment of this RtfHeaderFooter. Passes the setting
  on to the contained element.