Hi,
I'm trying to dynamically generate a pdf from a jsp but get a blank page instead. I'm using an IE browser, jboss with jetty. I can write this to file but i can't seem to stream it out to the browser. I don't get any errors, only a blank modal window for my page.
here's some of my code:
response.setContentType( "application/pdf" );
ByteArrayOutputStream buffer = new ByteArrayOutputStream();
com.lowagie.text.Document pdfDoc = new com.lowagie.text.Document(com.lowagie.text.PageSize.A4.rotate(), 30, 30, 70, 30);
com.lowagie.text.pdf.PdfWriter.getInstance( pdfDoc, buffer);
//OPEN DOCUMENT
pdfDoc.open();
// pdf doc is created here
pdfDoc.close();
DataOutput output = new DataOutputStream( response.getOutputStream() );
byte[] bytes = buffer.toByteArray();
response.setContentLength(bytes.length);
for( int i = 0; i < bytes.length; i++ ) { output.writeByte( bytes[i] ); }
Do you Yahoo!?
Yahoo! Platinum - Watch CBS' NCAA March Madness, live on your desktop!
