<include name="xml-apis*.jar"/>
<include name="xerces*.jar"/>
<include name="xalan*.jar"/>
+ <include name="serializer*.jar"/>
<include name="commons-io*.jar"/>
<include name="commons-logging*.jar"/>
<include name="xmlgraphics-commons*.jar"/>
import javax.xml.transform.sax.SAXResult;
// FOP
+import org.apache.commons.io.IOUtils;
import org.apache.fop.apps.FOUserAgent;
import org.apache.fop.apps.Fop;
import org.apache.fop.apps.FOPException;
// Start XSLT transformation and FOP processing
transformer.transform(src, res);
} finally {
- out.close();
+ IOUtils.closeQuietly(out);
}
return fop.getResults();
}
File fofile = new File(baseDir, foname);
String pdfname = foname;
- pdfname.replaceFirst("\\.fo", ".pdf");
+ int p = foname.lastIndexOf('.');
+ pdfname = foname.substring(0, p) + ".pdf";
File pdffile = new File(outDir, pdfname);
// transform and render