code: private final void renderHeader(PdfWriter writer, Document document) throws DocumentException, VectorPrintException {
        if ((!debugHereAfter && getSettings().getBooleanProperty(false, DEBUG))
            || (!failuresHereAfter && !getSettings().getBooleanProperty(false, DEBUG))) {
           
           writer.getDirectContent().addImage(getTemplateImage(template));
           
           if (getSettings().getBooleanProperty(false, DEBUG)) {
              ArrayList a = new ArrayList(2);
              a.add(PdfName.TOGGLE);
              a.add(elementProducer.initLayerGroup(DEBUG, writer.getDirectContent()));
              PdfAction act = PdfAction.setOCGstate(a, true);
              Chunk h = new Chunk("toggle debug info", DebugHelper.debugFontLink(writer.getDirectContent(), getSettings())).setAction(act);
              
              ColumnText.showTextAligned(writer.getDirectContent(), Element.ALIGN_LEFT, new Phrase(h), 10, document.top() - 15, 0);
              Font f = DebugHelper.debugFontLink(writer.getDirectContent(), getSettings());
  //            act = PdfAction.gotoLocalPage("debugpage", true);
  
              elementProducer.startLayerInGroup(DEBUG, writer.getDirectContent());
              
              h = new Chunk(getSettings().getProperty("go to debug legend", "debugheader"), f).setLocalGoto(BaseReportGenerator.DEBUGPAGE);
              ColumnText.showTextAligned(writer.getDirectContent(), Element.ALIGN_LEFT, new Phrase(h), 10, document.top() - 3, 0);
              
              writer.getDirectContent().endLayer();
              
           }
        }
     }
docs: prints a failure and / or a debug header when applicable.
  
  @see #getTemplateImage(com.itextpdf.text.pdf.PdfTemplate)
  @param writer
  @param document
  @throws DocumentException
  @throws VectorPrintException