Has anyone encountered this problem before? I'm trying to render a PDF document through the browser. It's working fine in Firefox, but i get an "IE cannot display the page" error page. Here's my code:
String xml = "<PdfBean/>";
StreamSource xmlSource = new StreamSource(new ByteArrayInputStream(xml.getBytes()));
InputStream is = new
ByteArrayInputStream(xsltext.getBytes("UTF-8"));
StreamSource xslSource = new StreamSource(is);
TransformerFactory tfactory = TransformerFactory.newInstance();
Transformer transformer = tfactory.newTransformer(xslSource);
FopFactory fopFactory = FopFactory.newInstance();
FOUserAgent foUserAgent = fopFactory.newFOUserAgent();
foUserAgent.setProducer(this.getClass().getName());
ByteArrayOutputStream out = new ByteArrayOutputStream();
Fop fop = fopFactory.newFop(MimeConstants.MIME_PDF,out);
// perform transformation
Result res = new SAXResult(fop.getDefaultHandler());
transformer.transform(xmlSource, res);
//Prepare response
httpResponse.setContentType("application/pdf");
httpResponse.setContentLength(out.size());
//Send content to Browser
httpResponse.getOutputStream().write(out.toByteArray());
httpResponse.getOutputStream().flush();