diff options
author | Adrian Cumiskey <acumiskey@apache.org> | 2008-07-10 16:21:36 +0000 |
---|---|---|
committer | Adrian Cumiskey <acumiskey@apache.org> | 2008-07-10 16:21:36 +0000 |
commit | 8e94b3ad33854852846b6333e09e7cd38a2cc5e0 (patch) | |
tree | 6caf01ed0aaa8fa269a5db6f2257e613b2e0935e /src/java/org/apache/fop/cli | |
parent | 5ddeb9f9d6fbd800a6b7bac0892590657e2d31ba (diff) | |
download | xmlgraphics-fop-8e94b3ad33854852846b6333e09e7cd38a2cc5e0.tar.gz xmlgraphics-fop-8e94b3ad33854852846b6333e09e7cd38a2cc5e0.zip |
Committing the beginnings of what I began prototyping sometime ago... not sure how useful it is going forward.
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/Temp_AreaTreeNewDesign@675636 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org/apache/fop/cli')
-rw-r--r-- | src/java/org/apache/fop/cli/CommandLineOptions.java | 33 |
1 files changed, 32 insertions, 1 deletions
diff --git a/src/java/org/apache/fop/cli/CommandLineOptions.java b/src/java/org/apache/fop/cli/CommandLineOptions.java index 4e5c8ae44..ee2cba40c 100644 --- a/src/java/org/apache/fop/cli/CommandLineOptions.java +++ b/src/java/org/apache/fop/cli/CommandLineOptions.java @@ -45,6 +45,7 @@ import org.apache.fop.pdf.PDFEncryptionParams; import org.apache.fop.pdf.PDFXMode; import org.apache.fop.render.Renderer; import org.apache.fop.render.awt.AWTRenderer; +import org.apache.fop.render.iform.IFRenderer; import org.apache.fop.render.pdf.PDFRenderer; import org.apache.fop.render.print.PagesMode; import org.apache.fop.render.print.PrintRenderer; @@ -197,6 +198,13 @@ public class CommandLineOptions { //Make sure the prepared XMLRenderer is used foUserAgent.setRendererOverride(xmlRenderer); + } else if (MimeConstants.MIME_FOP_IF.equals(outputmode)) { + // render from FO to Intermediate Format + IFRenderer xml2Renderer = new IFRenderer(); + xml2Renderer.setUserAgent(foUserAgent); + + //Make sure the prepared IFRenderer is used + foUserAgent.setRendererOverride(xml2Renderer); } return true; } @@ -302,6 +310,8 @@ public class CommandLineOptions { i = i + parseUnknownOption(args, i); } else if (args[i].equals("-at")) { i = i + parseAreaTreeOption(args, i); + } else if (args[i].equals("-if")) { + i = i + parseIntermediateFormatOption(args, i); } else if (args[i].equals("-v")) { System.out.println("FOP Version " + Version.getVersion()); } else if (args[i].equals("-param")) { @@ -612,7 +622,7 @@ public class CommandLineOptions { if ((i + 1 == args.length) || (args[i + 1].charAt(0) == '-')) { throw new FOPException("you must specify the area-tree output file"); - } else if ((i + 2 == args.length) + } else if ((i + 2 == args.length) || (args[i + 2].charAt(0) == '-')) { // only output file is specified outfile = new File(args[i + 1]); @@ -625,6 +635,23 @@ public class CommandLineOptions { } } + private int parseIntermediateFormatOption(String[] args, int i) throws FOPException { + setOutputMode(MimeConstants.MIME_FOP_IF); + if ((i + 1 == args.length) + || (args[i + 1].charAt(0) == '-')) { + throw new FOPException("you must specify the intermediate format output file"); + } else if ((i + 2 == args.length) + || (args[i + 2].charAt(0) == '-')) { + // only output file is specified + outfile = new File(args[i + 1]); + return 1; + } else { + // mimic format and output file have been specified + outfile = new File(args[i + 2]); + return 2; + } + } + private int parseAreaTreeInputOption(String[] args, int i) throws FOPException { inputmode = AREATREE_INPUT; if ((i + 1 == args.length) @@ -1009,6 +1036,7 @@ public class CommandLineOptions { + " -at [mime] out representation of area tree as XML (outfile req'd) \n" + " specify optional mime output to allow AT to be converted\n" + " to final format later\n" + + " -if out representation of area tree as intermediate format XML (outfile req'd)\n" + " -print input file will be rendered and sent to the printer \n" + " see options with \"-print help\" \n" + " -out mime outfile input will be rendered using the given MIME type\n" @@ -1088,6 +1116,9 @@ public class CommandLineOptions { log.info("mimic renderer: " + mimicRenderer); } log.info("output file: " + outfile.toString()); + } else if (MimeConstants.MIME_FOP_IF.equals(outputmode)) { + log.info("intermediate format"); + log.info("output file: " + outfile.toString()); } else { log.info(outputmode); log.info("output file: " + outfile.toString()); |