> Could you please state which OutputStream implementation are
> used in your code?

Sorry....I didn't answer your question: java.io.FileOutputStream and
java.io.BufferedOutputStream.

A code snippet from the servlet appears below.

Thanks,
Jeff




// Setup output
OutputStream out = new java.io.FileOutputStream(pdfFile);
out = new java.io.BufferedOutputStream(out);

// Transform the XML+XSLT to PDF
try {

   // Create and configure the FOUserAgent
   FOUserAgent foUserAgent = fopFactory.newFOUserAgent();
   foUserAgent.setProducer("Oracle Pluggable Destination - DesXslFo");
   foUserAgent.setCreator("XXXXX");
   foUserAgent.setAuthor("XXXXX");
   foUserAgent.setCreationDate(new Date());
   foUserAgent.setBaseURL("file:///" + transformDir);

   // Construct fop with desired output format
   Fop fop = fopFactory.newFop(MimeConstants.MIME_PDF, foUserAgent, out);

   // Setup the transformer with the XSLT
   TransformerFactory factory = TransformerFactory.newInstance();
   Transformer transformer = factory.newTransformer(new
StreamSource(xsltFile));

   // Set the XSLT stylesheet version being used
   transformer.setParameter("versionParam", xsltVersion);

   // Setup input for XSLT transformation
   Source src = new StreamSource(xmlFile);

   // Resulting SAX events (the generated FO) must be piped through to FOP
   Result res = new SAXResult(fop.getDefaultHandler());

   // Start XSLT transformation and FOP processing
   transformer.transform(src, res);

   // Flush the buffered output before exiting
   out.flush();
   out.close();

   // Help garbage collection
   res = null;
   src = null;
   transformer = null;
   factory = null;
   fop = null;
   foUserAgent = null;

} catch (Exception e) {
   try { out.close(); } catch (Exception ignore) {}
   throw new Exception(e.getClass() + ": " + e.getMessage());
}       transformer = null;
        factory = null;
        fop = null;
        foUserAgent = null;

} catch (Exception e) {
        try { out.close(); } catch (Exception ignore) {}
        throw new Exception(e.getClass() + ": " + e.getMessage());
}



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to