aboutsummaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorAdrian Cumiskey <acumiskey@apache.org>2008-04-17 16:30:02 +0000
committerAdrian Cumiskey <acumiskey@apache.org>2008-04-17 16:30:02 +0000
commitc1293d0e53b566b1c7fc0cddef997785aabb73bd (patch)
tree09eff81e2a92ba69cb5a669f93647bcd806c9470 /examples
parent72e6f108465cc95fc96d82e9f519bc8b9c7709c3 (diff)
downloadxmlgraphics-fop-c1293d0e53b566b1c7fc0cddef997785aabb73bd.tar.gz
xmlgraphics-fop-c1293d0e53b566b1c7fc0cddef997785aabb73bd.zip
Merged revisions 648985,649012,649091,649119,649146,649149,649160 via svnmerge from
https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk ........ r648985 | jeremias | 2008-04-17 08:01:19 +0100 (Thu, 17 Apr 2008) | 1 line HeadURL was missing in the properties. ........ r649012 | jeremias | 2008-04-17 09:59:48 +0100 (Thu, 17 Apr 2008) | 2 lines Bugfix: Avoid stopping early when no EmbedFontInfos are found during font detection. Submitted by: Raphael Parree <rparree.at.gmail.com> ........ r649091 | jeremias | 2008-04-17 14:33:07 +0100 (Thu, 17 Apr 2008) | 7 lines Bugzilla #44678: Added ability to pass in the PrinterJob instance through the renderer options. Submitted by: Antti Karanta <Antti.Karanta.at.napa.fi> Modifications/Additions to patch: - Don't remove the contructor with the PrinterJob parameter, just deprecate it. - Adjust old-style print example to use renderer options ........ r649119 | vhennebert | 2008-04-17 15:10:04 +0100 (Thu, 17 Apr 2008) | 2 lines Fixed minor typo ........ r649146 | jeremias | 2008-04-17 16:12:23 +0100 (Thu, 17 Apr 2008) | 2 lines Bugzilla #41687: Restored ability to specify from/to and odd/even pages as well as the number of copies for printing from the command-line. Note that this is no longer done via system properties but through the renderer options. Syntax is slightly different. See "fop -print help". ........ r649149 | jeremias | 2008-04-17 16:14:26 +0100 (Thu, 17 Apr 2008) | 2 lines Bugzilla #43383: Made sure the pages don't appear out of order in AWT preview. ........ r649160 | jeremias | 2008-04-17 17:01:41 +0100 (Thu, 17 Apr 2008) | 3 lines Now tunneling all events through a special event listener in tests. This serves two purposes: - Better readability of the test output. - Identification of messages that are not sent through the event subsystem, yet. ........ git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/Temp_AFPGOCAResources@649175 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'examples')
-rw-r--r--examples/embedding/java/embedding/ExampleFO2OldStylePrint.java24
1 files changed, 8 insertions, 16 deletions
diff --git a/examples/embedding/java/embedding/ExampleFO2OldStylePrint.java b/examples/embedding/java/embedding/ExampleFO2OldStylePrint.java
index 588d2c5d7..d9bc1d11d 100644
--- a/examples/embedding/java/embedding/ExampleFO2OldStylePrint.java
+++ b/examples/embedding/java/embedding/ExampleFO2OldStylePrint.java
@@ -24,21 +24,18 @@ import java.awt.print.PrinterJob;
import java.io.File;
import java.io.IOException;
-//JAXP
+import javax.xml.transform.Result;
+import javax.xml.transform.Source;
import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerFactory;
-import javax.xml.transform.Source;
-import javax.xml.transform.Result;
-import javax.xml.transform.stream.StreamSource;
import javax.xml.transform.sax.SAXResult;
+import javax.xml.transform.stream.StreamSource;
-
-// FOP
+import org.apache.fop.apps.FOPException;
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.render.print.PrintRenderer;
+import org.apache.fop.apps.MimeConstants;
/**
* This class demonstrates printing an FO file to a PrinterJob instance.
@@ -63,15 +60,10 @@ public class ExampleFO2OldStylePrint {
try {
//Set up a custom user agent so we can supply our own renderer instance
FOUserAgent userAgent = fopFactory.newFOUserAgent();
+ userAgent.getRendererOptions().put("printerjob", printerJob);
- //Set up our own PrintRenderer instance so we can supply a special PrinterJob instance.
- PrintRenderer renderer = new PrintRenderer(printerJob);
- renderer.setUserAgent(userAgent);
-
- userAgent.setRendererOverride(renderer);
-
- // Construct fop with desired output format (here, it is set through the user agent)
- Fop fop = fopFactory.newFop(userAgent);
+ // Construct FOP with desired output format
+ Fop fop = fopFactory.newFop(MimeConstants.MIME_FOP_PRINT, userAgent);
// Setup JAXP using identity transformer
TransformerFactory factory = TransformerFactory.newInstance();