public ByteArrayOutputStream getPDF(ScoreMatrix matrix)
	throws DocumentException
{
	String html = getHTML(matrix);	// get the html in a string

		// Set up the PDF Document object to be generated
	com.lowagie.text.Document pdfDoc = new com.lowagie.text.Document();
	pdfDoc.setPageSize(PageSize.LETTER);	// letter size
	pdfDoc.setMargins(0f, 0f, 0f, 0f);		// use the whole area
	ByteArrayOutputStream ba = new ByteArrayOutputStream();
        try {
			// Create a PDF writer
		PdfWriter writer = PdfWriter.getInstance(pdfDoc, ba);
			// Open the document
		pdfDoc.open();
			// make a reader on the string and parse it
 		StringReader sr = new StringReader(html);
		HtmlParser.parse(pdfDoc, sr);
	}
	finally
	{
		pdfDoc.close();
	}
	return(ba);
}