aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Pepping <spepping@apache.org>2006-02-22 20:50:56 +0000
committerSimon Pepping <spepping@apache.org>2006-02-22 20:50:56 +0000
commit458fb25653da3d3a472e91b48fee00bb53152d27 (patch)
treecf1de0941bce95f0272521a7d7c3cc14ff923c21
parentf729e663fd547a596274ff8f417ed331f9981f0c (diff)
downloadxmlgraphics-fop-458fb25653da3d3a472e91b48fee00bb53152d27.tar.gz
xmlgraphics-fop-458fb25653da3d3a472e91b48fee00bb53152d27.zip
Adapted this example to the new API.
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/Temp_API_Finalization@379883 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--examples/embedding/java/embedding/ExampleFO2PDF.java8
1 files changed, 7 insertions, 1 deletions
diff --git a/examples/embedding/java/embedding/ExampleFO2PDF.java b/examples/embedding/java/embedding/ExampleFO2PDF.java
index 32d4de3aa..aba3fad79 100644
--- a/examples/embedding/java/embedding/ExampleFO2PDF.java
+++ b/examples/embedding/java/embedding/ExampleFO2PDF.java
@@ -35,8 +35,10 @@ import javax.xml.transform.sax.SAXResult;
// FOP
+import org.apache.fop.apps.FOUserAgent;
import org.apache.fop.apps.Fop;
import org.apache.fop.apps.FOPException;
+import org.apache.fop.apps.FopFactory;
import org.apache.fop.apps.FormattingResults;
import org.apache.fop.apps.MimeConstants;
import org.apache.fop.apps.PageSequenceResults;
@@ -58,8 +60,12 @@ public class ExampleFO2PDF {
OutputStream out = null;
try {
+ FopFactory fopFactory = FopFactory.newInstance();
+ // configure fopFactory as desired
+ FOUserAgent foUserAgent = fopFactory.newFOUserAgent();
+ // configure foUserAgent as desired
// Construct fop with desired output format
- Fop fop = new Fop(MimeConstants.MIME_PDF);
+ Fop fop = fopFactory.newFop(MimeConstants.MIME_PDF, foUserAgent);
// Setup output stream. Note: Using BufferedOutputStream
// for performance reasons (helpful with FileOutputStreams).