protected DocWriter createWriter(final MBasicTable table,final Document document,final OutputStream out) throws DocumentException {
  final PdfWriter writer=PdfWriter.getInstance(document,out);
  if (table.getName() != null) {
    final HeaderFooter header=new HeaderFooter(new Phrase(table.getName()),false);
    header.setAlignment(Element.ALIGN_LEFT);
    header.setBorder(Rectangle.NO_BORDER);
    document.setHeader(header);
    document.addTitle(table.getName());
  }
  writer.setPageEvent(new AdvancedPageNumberEvents());
  return writer;
}

protected DocWriter createWriter ( final MBasicTable table , final Document document , final OutputStream out ) throws DocumentException { final PdfWriter writer = PdfWriter . getInstance ( document , out ) ; if ( table . getName ( ) != null ) { final HeaderFooter header = new HeaderFooter ( new Phrase ( table . getName ( ) ) , false ) ; header . setAlignment ( Element . ALIGN_LEFT ) ; header . setBorder ( Rectangle . NO_BORDER ) ; document . setHeader ( header ) ; document . addTitle ( table . getName ( ) ) ; } writer . setPageEvent ( new AdvancedPageNumberEvents ( ) ) ; return writer ; }
we create a writer that listens to the document and directs a pdf - stream to out
