Browse Source

Updates due to PCL support


git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@194149 13f79535-47bb-0310-9956-ffa450edef68
pull/33/head
arved 23 years ago
parent
commit
7649eae9b8

+ 49
- 2
src/org/apache/fop/apps/CommandLineOptions.java View File

@@ -36,6 +36,10 @@ public class CommandLineOptions {
private static final int MIF_OUTPUT = 3;
/* output: sent swing rendered file to printer */
private static final int PRINT_OUTPUT = 4;
/* output: pcl file */
private static final int PCL_OUTPUT = 5;
/* output: text file */
private static final int TXT_OUTPUT = 6;

/* use debug mode*/
Boolean errorDump = null;
@@ -177,8 +181,37 @@ public class CommandLineOptions {
printUsagePrintOutput();
}
}
}
else if (args[i].charAt(0) != '-') {
} else if (args[i].equals("-pcl")) {
if (outputmode == NOT_SET) {
outputmode = PCL_OUTPUT;
} else {
MessageHandler.errorln("ERROR: you can only set one output method");
printUsage();
}
if ((i + 1 == args.length) ||
(args[i + 1].charAt(0) == '-')) {
MessageHandler.errorln("ERROR: you must specify the pdf output file");
printUsage();
} else {
outfile = new File (args[i + 1]);
i++;
}
} else if (args[i].equals("-txt")) {
if (outputmode == NOT_SET) {
outputmode = TXT_OUTPUT;
} else {
MessageHandler.errorln("ERROR: you can only set one output method");
printUsage();
}
if ((i + 1 == args.length) ||
(args[i + 1].charAt(0) == '-')) {
MessageHandler.errorln("ERROR: you must specify the pdf output file");
printUsage();
} else {
outfile = new File (args[i + 1]);
i++;
}
} else if (args[i].charAt(0) != '-') {
if (inputmode == NOT_SET) {
inputmode = FO_INPUT;
fofile = new File (args[i]);
@@ -272,6 +305,10 @@ public class CommandLineOptions {
return Driver.RENDER_MIF;
case PRINT_OUTPUT:
return Driver.RENDER_PRINT;
case PCL_OUTPUT:
return Driver.RENDER_PCL;
case TXT_OUTPUT:
return Driver.RENDER_TXT;
default:
throw new FOPException("Invalid Renderer setting!");
}
@@ -411,6 +448,8 @@ public class CommandLineOptions {
" -pdf outfile input will be rendered as pdf file (outfile req'd) \n" +
" -awt input will be displayed on screen \n" +
" -mif outfile input will be rendered as mif file (outfile req'd)\n" +
" -pcl outfile input will be rendered as pcl file (outfile req'd) \n" +
" -txt outfile input will be rendered as text file (outfile req'd) \n" +
" -print input file will be rendered and sent to the printer \n" +
" see options with \"-print help\" \n\n" +
" [Examples]\n" + " Fop foo.fo foo.pdf \n" +
@@ -483,6 +522,14 @@ public class CommandLineOptions {
MessageHandler.logln("out file: " + outfile.toString());
}
break;
case PCL_OUTPUT:
MessageHandler.logln("pcl");
MessageHandler.logln("output file: " + outfile.toString());
break;
case TXT_OUTPUT:
MessageHandler.logln("txt");
MessageHandler.logln("output file: " + outfile.toString());
break;
default:
MessageHandler.logln("unknown input type");
}

+ 14
- 0
src/org/apache/fop/apps/Driver.java View File

@@ -103,6 +103,12 @@ public class Driver {
/** Render to PRINT. No OutputStream neccessary */
public static final int RENDER_PRINT = 5;

/** Render to PCL. OutputStream must be set */
public static final int RENDER_PCL = 6;

/** Render to Text. OutputStream must be set */
public static final int RENDER_TXT = 7;

/** the FO tree builder */
private FOTreeBuilder _treeBuilder;

@@ -207,6 +213,8 @@ public class Driver {
* <li>RENDER_AWT
* <li>RENDER_MIF
* <li>RENDER_XML
* <li>RENDER_PCL
* <li>RENDER_TXT
* </ul>
* @param renderer the type of renderer to use
*/
@@ -221,6 +229,12 @@ public class Driver {
throw new IllegalArgumentException("Use renderer form of setRenderer() for AWT");
case RENDER_PRINT:
throw new IllegalArgumentException("Use renderer form of setRenderer() for PRINT");
case RENDER_PCL:
setRenderer(new org.apache.fop.render.pcl.PCLRenderer());
break;
case RENDER_TXT:
setRenderer(new org.apache.fop.render.txt.TXTRenderer());
break;
case RENDER_MIF:
setRenderer(new org.apache.fop.render.mif.MIFRenderer());
break;

Loading…
Cancel
Save