Lines 234-239
public class CommandLineOptions {
Link Here
|
234 |
* @exception FOPException if there was an error in the format of the options |
234 |
* @exception FOPException if there was an error in the format of the options |
235 |
*/ |
235 |
*/ |
236 |
private boolean parseOptions(String[] args) throws FOPException { |
236 |
private boolean parseOptions(String[] args) throws FOPException { |
|
|
237 |
// do not throw an exception for no args |
238 |
if (args.length == 0) { |
239 |
printUsage(); |
240 |
System.exit(1); |
241 |
} |
237 |
for (int i = 0; i < args.length; i++) { |
242 |
for (int i = 0; i < args.length; i++) { |
238 |
if (args[i].equals("-x") |
243 |
if (args[i].equals("-x") |
239 |
|| args[i].equals("--dump-config")) { |
244 |
|| args[i].equals("--dump-config")) { |
Lines 305-310
public class CommandLineOptions {
Link Here
|
305 |
i = i + parseAreaTreeOption(args, i); |
310 |
i = i + parseAreaTreeOption(args, i); |
306 |
} else if (args[i].equals("-v")) { |
311 |
} else if (args[i].equals("-v")) { |
307 |
System.out.println("FOP Version " + Version.getVersion()); |
312 |
System.out.println("FOP Version " + Version.getVersion()); |
|
|
313 |
System.exit(1); |
308 |
} else if (args[i].equals("-param")) { |
314 |
} else if (args[i].equals("-param")) { |
309 |
if (i + 2 < args.length) { |
315 |
if (i + 2 < args.length) { |
310 |
String name = args[++i]; |
316 |
String name = args[++i]; |
Lines 331-336
public class CommandLineOptions {
Link Here
|
331 |
i = i + parseUnknownOption(args, i); |
337 |
i = i + parseUnknownOption(args, i); |
332 |
} else { |
338 |
} else { |
333 |
printUsage(); |
339 |
printUsage(); |
|
|
340 |
System.exit(1); |
334 |
return false; |
341 |
return false; |
335 |
} |
342 |
} |
336 |
} |
343 |
} |
Lines 1033-1040
public class CommandLineOptions {
Link Here
|
1033 |
* shows the commandline syntax including a summary of all available options and some examples |
1040 |
* shows the commandline syntax including a summary of all available options and some examples |
1034 |
*/ |
1041 |
*/ |
1035 |
public static void printUsage() { |
1042 |
public static void printUsage() { |
|
|
1043 |
// Remember that the user executes 'fop', not Fop. |
1036 |
System.err.println( |
1044 |
System.err.println( |
1037 |
"\nUSAGE\nFop [options] [-fo|-xml] infile [-xsl file] " |
1045 |
"\nUSAGE\nfop [options] [-fo|-xml] infile [-xsl file] " |
1038 |
+ "[-awt|-pdf|-mif|-rtf|-tiff|-png|-pcl|-ps|-txt|-at [mime]|-print] <outfile>\n" |
1046 |
+ "[-awt|-pdf|-mif|-rtf|-tiff|-png|-pcl|-ps|-txt|-at [mime]|-print] <outfile>\n" |
1039 |
+ " [OPTIONS] \n" |
1047 |
+ " [OPTIONS] \n" |
1040 |
+ " -d debug mode \n" |
1048 |
+ " -d debug mode \n" |
Lines 1095-1122
public class CommandLineOptions {
Link Here
|
1095 |
+ " XSL-FO file is saved and no rendering is performed. \n" |
1103 |
+ " XSL-FO file is saved and no rendering is performed. \n" |
1096 |
+ " (Only available if you use -xml and -xsl parameters)\n\n" |
1104 |
+ " (Only available if you use -xml and -xsl parameters)\n\n" |
1097 |
+ "\n" |
1105 |
+ "\n" |
1098 |
+ " [Examples]\n" + " Fop foo.fo foo.pdf \n" |
1106 |
+ " [Examples]\n" + " fop foo.fo foo.pdf \n" |
1099 |
+ " Fop -fo foo.fo -pdf foo.pdf (does the same as the previous line)\n" |
1107 |
+ " fop -fo foo.fo -pdf foo.pdf (does the same as the previous line)\n" |
1100 |
+ " Fop -xml foo.xml -xsl foo.xsl -pdf foo.pdf\n" |
1108 |
+ " fop -xml foo.xml -xsl foo.xsl -pdf foo.pdf\n" |
1101 |
+ " Fop -xml foo.xml -xsl foo.xsl -foout foo.fo\n" |
1109 |
+ " fop -xml foo.xml -xsl foo.xsl -foout foo.fo\n" |
1102 |
+ " Fop -xml - -xsl foo.xsl -pdf -\n" |
1110 |
+ " fop -xml - -xsl foo.xsl -pdf -\n" |
1103 |
+ " Fop foo.fo -mif foo.mif\n" |
1111 |
+ " fop foo.fo -mif foo.mif\n" |
1104 |
+ " Fop foo.fo -rtf foo.rtf\n" |
1112 |
+ " fop foo.fo -rtf foo.rtf\n" |
1105 |
+ " Fop foo.fo -print\n" |
1113 |
+ " fop foo.fo -print\n" |
1106 |
+ " Fop foo.fo -awt\n"); |
1114 |
+ " fop foo.fo -awt\n"); |
1107 |
} |
1115 |
} |
1108 |
|
1116 |
|
1109 |
/** |
1117 |
/** |
1110 |
* shows the options for print output |
1118 |
* shows the options for print output |
1111 |
*/ |
1119 |
*/ |
1112 |
private void printUsagePrintOutput() { |
1120 |
private void printUsagePrintOutput() { |
|
|
1121 |
// Remember that the user sees /fop', not Fop. |
1113 |
System.err.println("USAGE: -print [from[-to][,even|odd]] [-copies numCopies]\n\n" |
1122 |
System.err.println("USAGE: -print [from[-to][,even|odd]] [-copies numCopies]\n\n" |
1114 |
+ "Example:\n" |
1123 |
+ "Example:\n" |
1115 |
+ "all pages: Fop infile.fo -print\n" |
1124 |
+ "all pages: fop infile.fo -print\n" |
1116 |
+ "all pages with two copies: Fop infile.fo -print -copies 2\n" |
1125 |
+ "all pages with two copies: fop infile.fo -print -copies 2\n" |
1117 |
+ "all pages starting with page 7: Fop infile.fo -print 7\n" |
1126 |
+ "all pages starting with page 7: fop infile.fo -print 7\n" |
1118 |
+ "pages 2 to 3: Fop infile.fo -print 2-3\n" |
1127 |
+ "pages 2 to 3: fop infile.fo -print 2-3\n" |
1119 |
+ "only even page between 10 and 20: Fop infile.fo -print 10-20,even\n"); |
1128 |
+ "only even page between 10 and 20: fop infile.fo -print 10-20,even\n"); |
1120 |
} |
1129 |
} |
1121 |
|
1130 |
|
1122 |
/** |
1131 |
/** |