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;
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]);
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!");
}
" -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" +
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");
}
/** 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;
* <li>RENDER_AWT
* <li>RENDER_MIF
* <li>RENDER_XML
+ * <li>RENDER_PCL
+ * <li>RENDER_TXT
* </ul>
* @param renderer the type of renderer to use
*/
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;