I generate my PDF with iText through servlet and show the result directly to browser (using ByteArrayOutputStream method), but on "some" PCs give the error message "File does not begin with '%PDF-'" when the browser tries to open the PDF.
Does this error happen due to connection problem (so that the data stream is not completely received by client-side) ? What should I do to solve this problem ?
My codes:
ByteArrayOutputStream baosPDF = null;
baosPDF = generatePDFDocument();
response.setHeader("Content-disposition", "inline; filename=report.pdf");
response.setContentType("application/pdf");
response.setContentLength(baosPDF.size());
ServletOutputStream sos = response.getOutputStream();
baosPDF.writeTo(sos);
sos.flush();
sos.close();


_________________________________________________________________
Add photos to your e-mail with MSN 8. Get 2 months FREE*. http://join.msn.com/?page=features/featuredemail




-------------------------------------------------------
This SF.Net email sponsored by: ApacheCon 2003,
16-19 November in Las Vegas. Learn firsthand the latest
developments in Apache, PHP, Perl, XML, Java, MySQL,
WebDAV, and more! http://www.apachecon.com/
_______________________________________________
iText-questions mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Reply via email to