code: public void open() {
          super.open();
          try {
              writeComment(Document.getVersion());
              writeComment("CreationDate: " + new Date().toString());
              addTabs(1);
              writeEnd(HtmlTags.HEAD);
              addTabs(1);
              writeStart(HtmlTags.BODY);
              if (document.leftMargin() > 0) {
                  write(HtmlTags.LEFTMARGIN, String.valueOf(document.leftMargin()));
              }
              if (document.rightMargin() > 0) {
                  write(HtmlTags.RIGHTMARGIN, String.valueOf(document.rightMargin()));
              }
              if (document.topMargin() > 0) {
                  write(HtmlTags.TOPMARGIN, String.valueOf(document.topMargin()));
              }
              if (document.bottomMargin() > 0) {
                  write(HtmlTags.BOTTOMMARGIN, String.valueOf(document.bottomMargin()));
              }
              if (pageSize.getBackgroundColor() != null) {
                  write(HtmlTags.BACKGROUNDCOLOR, HtmlEncoder.encode(pageSize.getBackgroundColor()));
              }
              if (document.getJavaScript_onLoad() != null) {
                  write(HtmlTags.JAVASCRIPT_ONLOAD, HtmlEncoder.encode(document.getJavaScript_onLoad()));
              }
              if (document.getJavaScript_onUnLoad() != null) {
                  write(HtmlTags.JAVASCRIPT_ONUNLOAD, HtmlEncoder.encode(document.getJavaScript_onUnLoad()));
              }
              if (document.getHtmlStyleClass() != null) {
                  write(Markup.HTML_ATTR_CSS_CLASS, document.getHtmlStyleClass());
              }
              os.write(GT);
              initHeader(); // line added by David Freels
          }
          catch(IOException ioe) {
              throw new ExceptionConverter(ioe);
          }
      }
docs: Signals that the <CODE>Document</CODE> has been opened and that
  <CODE>Elements</CODE> can be added.
  <P>
  The <CODE>HEAD</CODE>-section of the HTML-document is written.