You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

CommandLineOptions.java 25KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706
  1. /* Copyright 1999-2004 The Apache Software Foundation.
  2. *
  3. * Licensed under the Apache License, Version 2.0 (the "License");
  4. * you may not use this file except in compliance with the License.
  5. * You may obtain a copy of the License at
  6. *
  7. * http://www.apache.org/licenses/LICENSE-2.0
  8. *
  9. * Unless required by applicable law or agreed to in writing, software
  10. * distributed under the License is distributed on an "AS IS" BASIS,
  11. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. * See the License for the specific language governing permissions and
  13. * limitations under the License.
  14. */
  15. /* $Id$ */
  16. package org.apache.fop.apps;
  17. // java
  18. import java.io.File;
  19. import java.io.FileNotFoundException;
  20. import java.util.Locale;
  21. import java.util.Vector;
  22. import org.apache.commons.logging.Log;
  23. import org.apache.commons.logging.LogFactory;
  24. import org.apache.commons.logging.impl.SimpleLog;
  25. /**
  26. * Options parses the commandline arguments
  27. */
  28. public class CommandLineOptions {
  29. /** input / output not set */
  30. public static final int NOT_SET = 0;
  31. /** input: fo file */
  32. public static final int FO_INPUT = 1;
  33. /** input: xml+xsl file */
  34. public static final int XSLT_INPUT = 2;
  35. /** output: pdf file */
  36. public static final int PDF_OUTPUT = 1;
  37. /** output: screen using swing */
  38. public static final int AWT_OUTPUT = 2;
  39. /** output: mif file */
  40. public static final int MIF_OUTPUT = 3;
  41. /** output: sent swing rendered file to printer */
  42. public static final int PRINT_OUTPUT = 4;
  43. /** output: pcl file */
  44. public static final int PCL_OUTPUT = 5;
  45. /** output: postscript file */
  46. public static final int PS_OUTPUT = 6;
  47. /** output: text file */
  48. public static final int TXT_OUTPUT = 7;
  49. /** output: svg file */
  50. public static final int SVG_OUTPUT = 8;
  51. /** output: XML area tree */
  52. public static final int AREA_OUTPUT = 9;
  53. /** output: RTF file */
  54. public static final int RTF_OUTPUT = 10;
  55. /* show configuration information */
  56. private Boolean showConfiguration = Boolean.FALSE;
  57. /* for area tree XML output, only down to block area level */
  58. private Boolean suppressLowLevelAreas = Boolean.FALSE;
  59. /* user configuration file */
  60. private File userConfigFile = null;
  61. /* input fo file */
  62. private File fofile = null;
  63. /* xsltfile (xslt transformation as input) */
  64. private File xsltfile = null;
  65. /* xml file (xslt transformation as input) */
  66. private File xmlfile = null;
  67. /* output file */
  68. private File outfile = null;
  69. /* input mode */
  70. private int inputmode = NOT_SET;
  71. /* output mode */
  72. private int outputmode = NOT_SET;
  73. private FOUserAgent foUserAgent;
  74. private Log log;
  75. private Vector xsltParams = null;
  76. /**
  77. * Construct a command line option object from command line arguments
  78. * @param args command line parameters
  79. * @throws FOPException for general errors
  80. * @throws FileNotFoundException if an input file wasn't found.
  81. */
  82. public CommandLineOptions(String[] args)
  83. throws FOPException, FileNotFoundException {
  84. log = LogFactory.getLog("FOP");
  85. boolean optionsParsed = true;
  86. foUserAgent = new FOUserAgent();
  87. try {
  88. optionsParsed = parseOptions(args);
  89. if (optionsParsed) {
  90. if (showConfiguration == Boolean.TRUE) {
  91. dumpConfiguration();
  92. }
  93. checkSettings();
  94. }
  95. } catch (FOPException e) {
  96. printUsage();
  97. throw e;
  98. } catch (java.io.FileNotFoundException e) {
  99. printUsage();
  100. throw e;
  101. }
  102. }
  103. /**
  104. * Get the logger.
  105. * @return the logger
  106. */
  107. public Log getLogger() {
  108. return log;
  109. }
  110. /**
  111. * parses the commandline arguments
  112. * @return true if parse was successful and processing can continue, false
  113. * if processing should stop
  114. * @exception FOPException if there was an error in the format of the options
  115. */
  116. private boolean parseOptions(String[] args) throws FOPException {
  117. for (int i = 0; i < args.length; i++) {
  118. if (args[i].equals("-x")
  119. || args[i].equals("--dump-config")) {
  120. showConfiguration = Boolean.TRUE;
  121. } else if (args[i].equals("-c")) {
  122. i = i + parseConfigurationOption(args, i);
  123. } else if (args[i].equals("-l")) {
  124. i = i + parseLanguageOption(args, i);
  125. } else if (args[i].equals("-s")) {
  126. suppressLowLevelAreas = Boolean.TRUE;
  127. } else if (args[i].equals("-fo")) {
  128. i = i + parseFOInputOption(args, i);
  129. } else if (args[i].equals("-xsl")) {
  130. i = i + parseXSLInputOption(args, i);
  131. } else if (args[i].equals("-xml")) {
  132. i = i + parseXMLInputOption(args, i);
  133. } else if (args[i].equals("-awt")) {
  134. i = i + parseAWTOutputOption(args, i);
  135. } else if (args[i].equals("-pdf")) {
  136. i = i + parsePDFOutputOption(args, i);
  137. } else if (args[i].equals("-mif")) {
  138. i = i + parseMIFOutputOption(args, i);
  139. } else if (args[i].equals("-rtf")) {
  140. i = i + parseRTFOutputOption(args, i);
  141. } else if (args[i].equals("-print")) {
  142. i = i + parsePrintOutputOption(args, i);
  143. // show print help
  144. if (i + 1 < args.length) {
  145. if (args[i + 1].equals("help")) {
  146. printUsagePrintOutput();
  147. return false;
  148. }
  149. }
  150. } else if (args[i].equals("-pcl")) {
  151. i = i + parsePCLOutputOption(args, i);
  152. } else if (args[i].equals("-ps")) {
  153. i = i + parsePostscriptOutputOption(args, i);
  154. } else if (args[i].equals("-txt")) {
  155. i = i + parseTextOutputOption(args, i);
  156. } else if (args[i].equals("-svg")) {
  157. i = i + parseSVGOutputOption(args, i);
  158. } else if (args[i].charAt(0) != '-') {
  159. i = i + parseUnknownOption(args, i);
  160. } else if (args[i].equals("-at")) {
  161. i = i + parseAreaTreeOption(args, i);
  162. } else if (args[i].equals("-v")) {
  163. System.out.println("FOP Version " + Version.getVersion());
  164. } else if (args[i].equals("-param")) {
  165. if (i + 2 < args.length) {
  166. if (xsltParams == null) {
  167. xsltParams = new Vector();
  168. }
  169. String name = args[++i];
  170. xsltParams.addElement(name);
  171. String expression = args[++i];
  172. xsltParams.addElement(expression);
  173. } else {
  174. throw new FOPException("invalid param usage: use -param <name> <value>");
  175. }
  176. } else {
  177. printUsage();
  178. return false;
  179. }
  180. }
  181. return true;
  182. } // end parseOptions
  183. private int parseConfigurationOption(String[] args, int i) throws FOPException {
  184. if ((i + 1 == args.length)
  185. || (args[i + 1].charAt(0) == '-')) {
  186. throw new FOPException("if you use '-c', you must specify "
  187. + "the name of the configuration file");
  188. } else {
  189. userConfigFile = new File(args[i + 1]);
  190. return 1;
  191. }
  192. }
  193. private int parseLanguageOption(String[] args, int i) throws FOPException {
  194. if ((i + 1 == args.length)
  195. || (args[i + 1].charAt(0) == '-')) {
  196. throw new FOPException("if you use '-l', you must specify a language");
  197. } else {
  198. Locale.setDefault(new Locale(args[i + 1], ""));
  199. return 1;
  200. }
  201. }
  202. private int parseFOInputOption(String[] args, int i) throws FOPException {
  203. inputmode = FO_INPUT;
  204. if ((i + 1 == args.length)
  205. || (args[i + 1].charAt(0) == '-')) {
  206. throw new FOPException("you must specify the fo file for the '-fo' option");
  207. } else {
  208. fofile = new File(args[i + 1]);
  209. return 1;
  210. }
  211. }
  212. private int parseXSLInputOption(String[] args, int i) throws FOPException {
  213. inputmode = XSLT_INPUT;
  214. if ((i + 1 == args.length)
  215. || (args[i + 1].charAt(0) == '-')) {
  216. throw new FOPException("you must specify the stylesheet "
  217. + "file for the '-xsl' option");
  218. } else {
  219. xsltfile = new File(args[i + 1]);
  220. return 1;
  221. }
  222. }
  223. private int parseXMLInputOption(String[] args, int i) throws FOPException {
  224. inputmode = XSLT_INPUT;
  225. if ((i + 1 == args.length)
  226. || (args[i + 1].charAt(0) == '-')) {
  227. throw new FOPException("you must specify the input file "
  228. + "for the '-xml' option");
  229. } else {
  230. xmlfile = new File(args[i + 1]);
  231. return 1;
  232. }
  233. }
  234. private int parseAWTOutputOption(String[] args, int i) throws FOPException {
  235. setOutputMode(AWT_OUTPUT);
  236. return 0;
  237. }
  238. private int parsePDFOutputOption(String[] args, int i) throws FOPException {
  239. setOutputMode(PDF_OUTPUT);
  240. if ((i + 1 == args.length)
  241. || (args[i + 1].charAt(0) == '-')) {
  242. throw new FOPException("you must specify the pdf output file");
  243. } else {
  244. outfile = new File(args[i + 1]);
  245. return 1;
  246. }
  247. }
  248. private int parseMIFOutputOption(String[] args, int i) throws FOPException {
  249. setOutputMode(MIF_OUTPUT);
  250. if ((i + 1 == args.length)
  251. || (args[i + 1].charAt(0) == '-')) {
  252. throw new FOPException("you must specify the mif output file");
  253. } else {
  254. outfile = new File(args[i + 1]);
  255. return 1;
  256. }
  257. }
  258. private int parseRTFOutputOption(String[] args, int i) throws FOPException {
  259. setOutputMode(RTF_OUTPUT);
  260. if ((i + 1 == args.length)
  261. || (args[i + 1].charAt(0) == '-')) {
  262. throw new FOPException("you must specify the rtf output file");
  263. } else {
  264. outfile = new File(args[i + 1]);
  265. return 1;
  266. }
  267. }
  268. private int parsePrintOutputOption(String[] args, int i) throws FOPException {
  269. setOutputMode(PRINT_OUTPUT);
  270. return 0;
  271. }
  272. private int parsePCLOutputOption(String[] args, int i) throws FOPException {
  273. setOutputMode(PCL_OUTPUT);
  274. if ((i + 1 == args.length)
  275. || (args[i + 1].charAt(0) == '-')) {
  276. throw new FOPException("you must specify the pdf output file");
  277. } else {
  278. outfile = new File(args[i + 1]);
  279. return 1;
  280. }
  281. }
  282. private int parsePostscriptOutputOption(String[] args, int i) throws FOPException {
  283. setOutputMode(PS_OUTPUT);
  284. if ((i + 1 == args.length)
  285. || (args[i + 1].charAt(0) == '-')) {
  286. throw new FOPException("you must specify the PostScript output file");
  287. } else {
  288. outfile = new File(args[i + 1]);
  289. return 1;
  290. }
  291. }
  292. private int parseTextOutputOption(String[] args, int i) throws FOPException {
  293. setOutputMode(TXT_OUTPUT);
  294. if ((i + 1 == args.length)
  295. || (args[i + 1].charAt(0) == '-')) {
  296. throw new FOPException("you must specify the text output file");
  297. } else {
  298. outfile = new File(args[i + 1]);
  299. return 1;
  300. }
  301. }
  302. private int parseSVGOutputOption(String[] args, int i) throws FOPException {
  303. setOutputMode(SVG_OUTPUT);
  304. if ((i + 1 == args.length)
  305. || (args[i + 1].charAt(0) == '-')) {
  306. throw new FOPException("you must specify the svg output file");
  307. } else {
  308. outfile = new File(args[i + 1]);
  309. return 1;
  310. }
  311. }
  312. private int parseUnknownOption(String[] args, int i) throws FOPException {
  313. if (inputmode == NOT_SET) {
  314. inputmode = FO_INPUT;
  315. fofile = new File(args[i]);
  316. } else if (outputmode == NOT_SET) {
  317. outputmode = PDF_OUTPUT;
  318. outfile = new File(args[i]);
  319. } else {
  320. throw new FOPException("Don't know what to do with "
  321. + args[i]);
  322. }
  323. return 0;
  324. }
  325. private int parseAreaTreeOption(String[] args, int i) throws FOPException {
  326. setOutputMode(AREA_OUTPUT);
  327. if ((i + 1 == args.length)
  328. || (args[i + 1].charAt(0) == '-')) {
  329. throw new FOPException("you must specify the area-tree output file");
  330. } else {
  331. outfile = new File(args[i + 1]);
  332. return 1;
  333. }
  334. }
  335. private void setOutputMode(int mode) throws FOPException {
  336. if (outputmode == NOT_SET) {
  337. outputmode = mode;
  338. } else {
  339. throw new FOPException("you can only set one output method");
  340. }
  341. }
  342. /**
  343. * checks whether all necessary information has been given in a consistent way
  344. */
  345. private void checkSettings() throws FOPException, FileNotFoundException {
  346. if (inputmode == NOT_SET) {
  347. throw new FOPException("No input file specified");
  348. }
  349. if (outputmode == NOT_SET) {
  350. throw new FOPException("No output file specified");
  351. }
  352. if (inputmode == XSLT_INPUT) {
  353. // check whether xml *and* xslt file have been set
  354. if (xmlfile == null) {
  355. throw new FOPException("XML file must be specified for the transform mode");
  356. }
  357. if (xsltfile == null) {
  358. throw new FOPException("XSLT file must be specified for the transform mode");
  359. }
  360. // warning if fofile has been set in xslt mode
  361. if (fofile != null) {
  362. log.warn("Can't use fo file with transform mode! Ignoring.\n"
  363. + "Your input is " + "\n xmlfile: "
  364. + xmlfile.getAbsolutePath()
  365. + "\nxsltfile: "
  366. + xsltfile.getAbsolutePath()
  367. + "\n fofile: "
  368. + fofile.getAbsolutePath());
  369. }
  370. if (!xmlfile.exists()) {
  371. throw new FileNotFoundException("Error: xml file "
  372. + xmlfile.getAbsolutePath()
  373. + " not found ");
  374. }
  375. if (!xsltfile.exists()) {
  376. throw new FileNotFoundException("Error: xsl file "
  377. + xsltfile.getAbsolutePath()
  378. + " not found ");
  379. }
  380. } else if (inputmode == FO_INPUT) {
  381. if (xmlfile != null || xsltfile != null) {
  382. log.warn("fo input mode, but xmlfile or xslt file are set:");
  383. log.error("xml file: " + xmlfile.toString());
  384. log.error("xslt file: " + xsltfile.toString());
  385. }
  386. if (!fofile.exists()) {
  387. throw new FileNotFoundException("Error: fo file "
  388. + fofile.getAbsolutePath()
  389. + " not found ");
  390. }
  391. }
  392. } // end checkSettings
  393. /**
  394. * @return the type chosen renderer
  395. * @throws FOPException for invalid output modes
  396. */
  397. public int getRenderer() throws FOPException {
  398. switch (outputmode) {
  399. case NOT_SET:
  400. throw new FOPException("Renderer has not been set!");
  401. case PDF_OUTPUT:
  402. return Driver.RENDER_PDF;
  403. case AWT_OUTPUT:
  404. return Driver.RENDER_AWT;
  405. case MIF_OUTPUT:
  406. return Driver.RENDER_MIF;
  407. case PRINT_OUTPUT:
  408. return Driver.RENDER_PRINT;
  409. case PCL_OUTPUT:
  410. return Driver.RENDER_PCL;
  411. case PS_OUTPUT:
  412. return Driver.RENDER_PS;
  413. case TXT_OUTPUT:
  414. return Driver.RENDER_TXT;
  415. case SVG_OUTPUT:
  416. return Driver.RENDER_SVG;
  417. case AREA_OUTPUT:
  418. foUserAgent.getRendererOptions().put("fineDetail", isCoarseAreaXml());
  419. return Driver.RENDER_XML;
  420. case RTF_OUTPUT:
  421. return Driver.RENDER_RTF;
  422. default:
  423. throw new FOPException("Invalid Renderer setting!");
  424. }
  425. }
  426. /**
  427. * Get the input handler.
  428. * @return the input handler
  429. * @throws FOPException if creating the InputHandler fails
  430. */
  431. public InputHandler getInputHandler() throws FOPException {
  432. switch (inputmode) {
  433. case FO_INPUT:
  434. return new FOFileHandler(fofile);
  435. case XSLT_INPUT:
  436. return new XSLTInputHandler(xmlfile, xsltfile, xsltParams);
  437. default:
  438. throw new FOPException("Invalid inputmode setting!");
  439. }
  440. }
  441. /**
  442. * Get the FOUserAgent for this Command-Line run
  443. * @return FOUserAgent instance
  444. */
  445. protected FOUserAgent getFOUserAgent() {
  446. return foUserAgent;
  447. }
  448. /**
  449. * Returns the input mode (type of input data, ex. NOT_SET or FO_INPUT)
  450. * @return the input mode
  451. */
  452. public int getInputMode() {
  453. return inputmode;
  454. }
  455. /**
  456. * Returns the output mode (output format, ex. NOT_SET or PDF_OUTPUT)
  457. * @return the output mode
  458. */
  459. public int getOutputMode() {
  460. return outputmode;
  461. }
  462. /**
  463. * Returns the XSL-FO file if set.
  464. * @return the XSL-FO file, null if not set
  465. */
  466. public File getFOFile() {
  467. return fofile;
  468. }
  469. /**
  470. * Returns the input XML file if set.
  471. * @return the input XML file, null if not set
  472. */
  473. public File getXMLFile() {
  474. return xmlfile;
  475. }
  476. /**
  477. * Returns the stylesheet to be used for transformation to XSL-FO.
  478. * @return stylesheet
  479. */
  480. public File getXSLFile() {
  481. return xsltfile;
  482. }
  483. /**
  484. * Returns the output file
  485. * @return the output file
  486. */
  487. public File getOutputFile() {
  488. return outfile;
  489. }
  490. /**
  491. * Returns the user configuration file to be used.
  492. * @return the userconfig.xml file
  493. */
  494. public File getUserConfigFile() {
  495. return userConfigFile;
  496. }
  497. /**
  498. * Indicates whether the XML renderer should generate course area XML
  499. * @return true if coarse area XML is desired
  500. */
  501. public Boolean isCoarseAreaXml() {
  502. return suppressLowLevelAreas;
  503. }
  504. /**
  505. * Returns the input file.
  506. * @return either the fofile or the xmlfile
  507. */
  508. public File getInputFile() {
  509. switch (inputmode) {
  510. case FO_INPUT:
  511. return fofile;
  512. case XSLT_INPUT:
  513. return xmlfile;
  514. default:
  515. return fofile;
  516. }
  517. }
  518. /**
  519. * shows the commandline syntax including a summary of all available options and some examples
  520. */
  521. public static void printUsage() {
  522. System.err.println(
  523. "\nUSAGE\nFop [options] [-fo|-xml] infile [-xsl file] "
  524. + "[-awt|-pdf|-mif|-rtf|-pcl|-ps|-txt|-at|-print] <outfile>\n"
  525. + " [OPTIONS] \n"
  526. + " -x dump configuration settings \n"
  527. + " -c cfg.xml use additional configuration file cfg.xml\n"
  528. + " -l lang the language to use for user information \n"
  529. + " -s for area tree XML, down to block areas only\n"
  530. + " -v to show FOP version being used\n\n"
  531. + " [INPUT] \n"
  532. + " infile xsl:fo input file (the same as the next) \n"
  533. + " -fo infile xsl:fo input file \n"
  534. + " -xml infile xml input file, must be used together with -xsl \n"
  535. + " -xsl stylesheet xslt stylesheet \n \n"
  536. /* + " -param name value <value> to use for parameter <name> in xslt stylesheet\n"
  537. + " (repeat '-param name value' for each parameter)\n \n" */
  538. + " [OUTPUT] \n"
  539. + " outfile input will be rendered as pdf file into outfile \n"
  540. + " -pdf outfile input will be rendered as pdf file (outfile req'd) \n"
  541. + " -awt input will be displayed on screen \n"
  542. + " -mif outfile input will be rendered as mif file (outfile req'd)\n"
  543. + " -rtf outfile input will be rendered as rtf file (outfile req'd)\n"
  544. + " -pcl outfile input will be rendered as pcl file (outfile req'd) \n"
  545. + " -ps outfile input will be rendered as PostScript file (outfile req'd) \n"
  546. + " -txt outfile input will be rendered as text file (outfile req'd) \n"
  547. + " -svg outfile input will be rendered as an svg slides file (outfile req'd) \n"
  548. + " -at outfile representation of area tree as XML (outfile req'd) \n"
  549. + " -print input file will be rendered and sent to the printer \n"
  550. + " see options with \"-print help\" \n\n"
  551. + " [Examples]\n" + " Fop foo.fo foo.pdf \n"
  552. + " Fop -fo foo.fo -pdf foo.pdf (does the same as the previous line)\n"
  553. + " Fop -xml foo.xml -xsl foo.xsl -pdf foo.pdf\n"
  554. + " Fop foo.fo -mif foo.mif\n"
  555. + " Fop foo.fo -rtf foo.rtf\n"
  556. + " Fop foo.fo -print or Fop -print foo.fo \n"
  557. + " Fop foo.fo -awt \n");
  558. }
  559. /**
  560. * shows the options for print output
  561. */
  562. private void printUsagePrintOutput() {
  563. System.err.println("USAGE: -print [-Dstart=i] [-Dend=i] [-Dcopies=i] [-Deven=true|false] "
  564. + " org.apache.fop.apps.Fop (..) -print \n"
  565. + "Example:\n"
  566. + "java -Dstart=1 -Dend=2 org.apache.Fop.apps.Fop infile.fo -print ");
  567. }
  568. /**
  569. * Outputs all commandline settings
  570. */
  571. private void dumpConfiguration() {
  572. log.info("Input mode: ");
  573. switch (inputmode) {
  574. case NOT_SET:
  575. log.info("not set");
  576. break;
  577. case FO_INPUT:
  578. log.info("FO ");
  579. log.info("fo input file: " + fofile.toString());
  580. break;
  581. case XSLT_INPUT:
  582. log.info("xslt transformation");
  583. log.info("xml input file: " + xmlfile.toString());
  584. log.info("xslt stylesheet: " + xsltfile.toString());
  585. break;
  586. default:
  587. log.info("unknown input type");
  588. }
  589. log.info("Output mode: ");
  590. switch (outputmode) {
  591. case NOT_SET:
  592. log.info("not set");
  593. break;
  594. case PDF_OUTPUT:
  595. log.info("pdf");
  596. log.info("output file: " + outfile.toString());
  597. break;
  598. case AWT_OUTPUT:
  599. log.info("awt on screen");
  600. if (outfile != null) {
  601. log.error("awt mode, but outfile is set:");
  602. log.info("out file: " + outfile.toString());
  603. }
  604. break;
  605. case MIF_OUTPUT:
  606. log.info("mif");
  607. log.info("output file: " + outfile.toString());
  608. break;
  609. case RTF_OUTPUT:
  610. log.info("rtf");
  611. log.info("output file: " + outfile.toString());
  612. break;
  613. case PRINT_OUTPUT:
  614. log.info("print directly");
  615. if (outfile != null) {
  616. log.error("print mode, but outfile is set:");
  617. log.error("out file: " + outfile.toString());
  618. }
  619. break;
  620. case PCL_OUTPUT:
  621. log.info("pcl");
  622. log.info("output file: " + outfile.toString());
  623. break;
  624. case PS_OUTPUT:
  625. log.info("PostScript");
  626. log.info("output file: " + outfile.toString());
  627. break;
  628. case TXT_OUTPUT:
  629. log.info("txt");
  630. log.info("output file: " + outfile.toString());
  631. break;
  632. case SVG_OUTPUT:
  633. log.info("svg");
  634. log.info("output file: " + outfile.toString());
  635. break;
  636. default:
  637. log.info("unknown input type");
  638. }
  639. log.info("OPTIONS");
  640. if (userConfigFile != null) {
  641. log.info("user configuration file: "
  642. + userConfigFile.toString());
  643. } else {
  644. log.info("no user configuration file is used [default]");
  645. }
  646. }
  647. }