]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
Bugzilla #39416:
authorJeremias Maerki <jeremias@apache.org>
Thu, 27 Apr 2006 07:33:19 +0000 (07:33 +0000)
committerJeremias Maerki <jeremias@apache.org>
Thu, 27 Apr 2006 07:33:19 +0000 (07:33 +0000)
JDK 1.3 compatibility.
Added missing serializer*.jar to the classpath.

git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@397466 13f79535-47bb-0310-9956-ffa450edef68

examples/embedding/build.xml
examples/embedding/java/embedding/MultipleFO2PDF.java

index fc9c84baa9738e2e3109c1f1f79382d2879782fa..6861429ba0f3cded0a90798b06e4eb04015b7bcc 100644 (file)
@@ -37,6 +37,7 @@
         <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"/>
index eccdba46bab38ed0e925ab1741acc4988cc898cd..6a0e1146de3fec2c63a33ef510f1156f52a00bff 100644 (file)
@@ -36,6 +36,7 @@ import javax.xml.transform.stream.StreamSource;
 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;
@@ -97,7 +98,7 @@ public class MultipleFO2PDF {
             // Start XSLT transformation and FOP processing
             transformer.transform(src, res);
         } finally {
-            out.close();
+            IOUtils.closeQuietly(out);
         }
 
         return fop.getResults();
@@ -131,7 +132,8 @@ public class MultipleFO2PDF {
                 }
                 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