code: public void setRtfDocument(RtfDocument doc) {
          this.document = doc;
          if(this.document != null) {
              for(int i = 0; i < this.content.length; i++) {
                  try {
                      if(this.content[i] instanceof Element) {
                          this.content[i] = this.document.getMapper().mapElement((Element) this.content[i])[0];
                          ((RtfBasicElement) this.content[i]).setInHeader(true);
                      } else if(this.content[i] instanceof RtfBasicElement){
                          ((RtfBasicElement) this.content[i]).setRtfDocument(this.document);
                          ((RtfBasicElement) this.content[i]).setInHeader(true);
                      }
                  } catch(DocumentException de) {
                      de.printStackTrace();
                  }
              }
          }
      }
docs: Sets the RtfDocument this RtfElement belongs to
  
  @param doc The RtfDocument to use