]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
Adapted this example to the new API.
authorSimon Pepping <spepping@apache.org>
Wed, 22 Feb 2006 20:50:56 +0000 (20:50 +0000)
committerSimon Pepping <spepping@apache.org>
Wed, 22 Feb 2006 20:50:56 +0000 (20:50 +0000)
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/Temp_API_Finalization@379883 13f79535-47bb-0310-9956-ffa450edef68

examples/embedding/java/embedding/ExampleFO2PDF.java

index 32d4de3aa700e7d2bfb39e852a93a90fd60519dd..aba3fad7939d76457aae73e245b28540e0b15d79 100644 (file)
@@ -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).