Hi All,
 We are using an action class to generate PDF document. We want to use the
v.93 of fop.jar file. However looks like in the new jar file "
org.apache.fop.apps.Driver" is missing. Is there an alternate method I need
to use or should I rewrite the action class.


private ByteArrayOutputStream transformXMLDocument(String
xslFile,XMLDocument xml,HttpServletRequest request) throws
MalformedURLException, XSLException, UnsupportedEncodingException,
IOException, FOPException {
 ByteArrayOutputStream out = new ByteArrayOutputStream();
 xslFile = this.getServlet().getServletContext().getRealPath(xslFile);
 URL fileURL = new URL("file:///" + xslFile);
 XSLProcessor xslProcessor = new XSLProcessor();
 XSLStylesheet xslStyleSheet = xslProcessor.newXSLStylesheet(fileURL);
 xslProcessor.setParam("", "loginId", "\" "+
getUserContext(request).getUserFullName()+" (" +getCurrentUserId(request) +
" )\"");
 xslProcessor.setParam("", "todaysDate", "\""+ ICaseUtil.getStringDate(new
Date(),ICaseConstants.DATE_FORMAT_TIME) + "\"");
 ByteArrayOutputStream out1 = new ByteArrayOutputStream();
 xslProcessor.processXSL(xslStyleSheet,xml, out1);
 String v_encode = "UTF-8";
 String fopString = new String(out1.toByteArray(),v_encode);
 Driver driver = new Driver();
 driver.setRenderer(Driver.RENDER_PDF);
 driver.setInputSource(new InputSource(new StringReader(fopString)));
 driver.setOutputStream(out);
 driver.run();
 return out;

}



Any help is appreciated.

Thanks in advance.

Vivek

Attachment: PrintReportAction.java
Description: Binary data

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

Reply via email to