code: public static void createPdf(final OutputStream result, final List<BufferedImage> images)
  		throws DocumentException, IOException
  	{
  		final Document document = new Document();
  		PdfWriter.getInstance(document, result);
  		for (final BufferedImage image : images)
  		{
  			final ByteArrayOutputStream baos = new ByteArrayOutputStream();
  			ImageIO.write(image, "png", baos);
  			final Image img = Image.getInstance(baos.toByteArray());
  			document.setPageSize(img);
  			document.newPage();
  			img.setAbsolutePosition(0, 0);
  			document.add(img);
  		}
  		document.close();
  	}
docs: Creates from the given Collection of images an pdf file.
  
  @param result
  the output stream from the pdf file where the images shell be written.
  @param images
  the BufferedImage collection to be written in the pdf file.
  @throws DocumentException
  is thrown if an error occurs when trying to get an instance of {@link PdfWriter}.
  @throws IOException
  Signals that an I/O exception has occurred.