diff options
author | Jeremias Maerki <jeremias@apache.org> | 2006-04-27 07:33:19 +0000 |
---|---|---|
committer | Jeremias Maerki <jeremias@apache.org> | 2006-04-27 07:33:19 +0000 |
commit | fc466abd9704dd97881d8650495e23eb947307fe (patch) | |
tree | eba3a92ffd5b7283ff82b50768405c54d49a2b6f /examples/embedding | |
parent | 6147427e8ae9cbdcfb995958a05202b811f7c558 (diff) | |
download | xmlgraphics-fop-fc466abd9704dd97881d8650495e23eb947307fe.tar.gz xmlgraphics-fop-fc466abd9704dd97881d8650495e23eb947307fe.zip |
Bugzilla #39416:
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
Diffstat (limited to 'examples/embedding')
-rw-r--r-- | examples/embedding/build.xml | 1 | ||||
-rw-r--r-- | examples/embedding/java/embedding/MultipleFO2PDF.java | 6 |
2 files changed, 5 insertions, 2 deletions
diff --git a/examples/embedding/build.xml b/examples/embedding/build.xml index fc9c84baa..6861429ba 100644 --- a/examples/embedding/build.xml +++ b/examples/embedding/build.xml @@ -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"/> diff --git a/examples/embedding/java/embedding/MultipleFO2PDF.java b/examples/embedding/java/embedding/MultipleFO2PDF.java index eccdba46b..6a0e1146d 100644 --- a/examples/embedding/java/embedding/MultipleFO2PDF.java +++ b/examples/embedding/java/embedding/MultipleFO2PDF.java @@ -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 |