code: protected void writePdf(final MBasicTable table, final OutputStream out) throws IOException {
  		try {
  			// step 1: creation of a document-object
  			final Rectangle pageSize = landscape ? PageSize.A4.rotate() : PageSize.A4;
  			final Document document = new Document(pageSize, 50, 50, 50, 50);
  			// step 2: we create a writer that listens to the document and directs a PDF-stream to out
  			createWriter(table, document, out);
  
  			// we add some meta information to the document, and we open it
  			document.addAuthor(System.getProperty("user.name"));
  			document.addCreator("JavaMelody");
  			final String title = buildTitle(table);
  			if (title != null) {
  				document.addTitle(title);
  			}
  			document.open();
  
  			// ouvre la boîte de dialogue Imprimer de Adobe Reader
  			// if (writer instanceof PdfWriter) {
  			// ((PdfWriter) writer).addJavaScript("this.print(true);", false);
  			// }
  
  			// table
  			final Table datatable = new Table(table.getColumnCount());
  			datatable.setCellsFitPage(true);
  			datatable.setPadding(4);
  			datatable.setSpacing(0);
  
  			// headers
  			renderHeaders(table, datatable);
  
  			// data rows
  			renderList(table, datatable);
  
  			document.add(datatable);
  
  			// we close the document
  			document.close();
  		} catch (final DocumentException e) {
  			// on ne peut déclarer d'exception autre que IOException en throws
  			throw new IOException(e);
  		}
  	}
docs: Ecrit le pdf.
  
  @param table
  MBasicTable
  @param out
  OutputStream
  @throws IOException
  e