private static final int SVG_OUTPUT = 8;
/* output: XML area tree */
private static final int AREA_OUTPUT = 9;
+ /* output: RTF file */
+ private static final int RTF_OUTPUT = 10;
/* show configuration information */
Boolean dumpConfiguration = Boolean.FALSE;
outfile = new File(args[i + 1]);
i++;
}
+ } else if (args[i].equals("-rtf")) {
+ setOutputMode(RTF_OUTPUT);
+ if ((i + 1 == args.length)
+ || (args[i + 1].charAt(0) == '-')) {
+ throw new FOPException("you must specify the rtf output file");
+ } else {
+ outfile = new File(args[i + 1]);
+ i++;
+ }
} else if (args[i].equals("-print")) {
setOutputMode(PRINT_OUTPUT);
// show print help
case AREA_OUTPUT:
rendererOptions.put("fineDetail", isCoarseAreaXml());
return Driver.RENDER_XML;
+ case RTF_OUTPUT:
+ return Driver.RENDER_RTF;
default:
throw new FOPException("Invalid Renderer setting!");
}
* shows the commandline syntax including a summary of all available options and some examples
*/
public static void printUsage() {
- System.err.println("\nUSAGE\nFop [options] [-fo|-xml] infile [-xsl file] [-awt|-pdf|-mif|-pcl|-ps|-txt|-at|-print] <outfile>\n"
+ System.err.println("\nUSAGE\nFop [options] [-fo|-xml] infile [-xsl file] [-awt|-pdf|-mif|-rtf|-pcl|-ps|-txt|-at|-print] <outfile>\n"
+ " [OPTIONS] \n"
+ " -d debug mode \n"
+ " -x dump configuration settings \n"
+ " -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"
+ + " -rtf outfile input will be rendered as rtf file (outfile req'd)\n"
+ " -pcl outfile input will be rendered as pcl file (outfile req'd) \n"
+ " -ps outfile input will be rendered as PostScript file (outfile req'd) \n"
+ " -txt outfile input will be rendered as text file (outfile req'd) \n"
+ " Fop -fo foo.fo -pdf foo.pdf (does the same as the previous line)\n"
+ " Fop -xsl foo.xsl -xml foo.xml -pdf foo.pdf\n"
+ " Fop foo.fo -mif foo.mif\n"
+ + " Fop foo.fo -rtf foo.rtf\n"
+ " Fop foo.fo -print or Fop -print foo.fo \n"
+ " Fop foo.fo -awt \n");
}
log.debug("mif");
log.debug("output file: " + outfile.toString());
break;
+ case RTF_OUTPUT:
+ log.debug("rtf");
+ log.debug("output file: " + outfile.toString());
+ break;
case PRINT_OUTPUT:
log.debug("print directly");
if (outfile != null) {
*/
public static final int RENDER_SVG = 9;
+ /**
+ * Render to RTF. OutputStream must be set
+ */
+ public static final int RENDER_RTF = 10;
+
/**
* the FO tree builder
*/
* <li>RENDER_PS
* <li>RENDER_TXT
* <li>RENDER_SVG
+ * <li>RENDER_RTF
* </ul>
* @param renderer the type of renderer to use
*/
case RENDER_SVG:
setRenderer("org.apache.fop.render.svg.SVGRenderer");
break;
+ case RENDER_RTF:
+ if(true) throw new IllegalArgumentException("-rtf option recognized but RTF output is not implemented yet");
+ break;
default:
throw new IllegalArgumentException("Unknown renderer type");
}
} else if (format.equalsIgnoreCase("application/vnd.mif") ||
format.equalsIgnoreCase("mif")) {
return Driver.RENDER_MIF;
+ } else if (format.equalsIgnoreCase("application/msword") ||
+ format.equalsIgnoreCase("application/rtf") ||
+ format.equalsIgnoreCase("rtf")) {
+ return Driver.RENDER_RTF;
} else if (format.equalsIgnoreCase("application/vnd.hp-PCL") ||
format.equalsIgnoreCase("pcl")) {
return Driver.RENDER_PCL;
return ".ps";
case Driver.RENDER_MIF:
return ".mif";
+ case Driver.RENDER_RTF:
+ return ".rtf";
case Driver.RENDER_PCL:
return ".pcl";
case Driver.RENDER_TXT: