public void startRenderer(OutputStream stream) throws IOException {
if (userAgent == null) {
throw new IllegalStateException("UserAgent must be set before starting the renderer");
}
ostream = stream;
this.pdfDoc = new PDFDocument(
userAgent.getProducer() != null ? userAgent.getProducer() : "");
this.pdfDoc.setCreator(userAgent.getCreator());
this.pdfDoc.setCreationDate(userAgent.getCreationDate());
this.pdfDoc.getInfo().setAuthor(userAgent.getAuthor());
this.pdfDoc.getInfo().setTitle(userAgent.getTitle());