Using the Commandline Interface to downCast requires a license that includes the API feature.
The downCast commandline interface essentially is the downCast API wrapped by a commandline-interpreting class and delivered as part of the downcast.jar. This is also the reason why a license including the API feature is required to use the commandline interface.
To access downCast via the commandline interface, start downCast as follows:
java -cp downcast.jar de.infinityloop.downcast.DowncastCmdline options...
Available options are:
Turns writing debug info into the log file on or off.
Specifies license file to use (absolute, local file system path). This license must include the API feature.
Adds the specified custom encoding file to the set of known encodings (absolute, local file system path).
Specifies a custom font configuration to be used (absolute, local file system path).
Adds the specified catalog file (absolute, local file system path) to the set of known catalogs.
Sets a parameter value to be passed/defined in a commandfile.
The name of a commandfile, which contains commands as listed here one per line. This is more convenient to write (since you can distribute options over several lines) and a necessity if on your system, the length of the commandline is limited to a certain number of characters.
The commandfile format is described here.
Specifies the user identification for this running instance of downCast (visible in log files).
Specifies a global downCast parameter.
Specifies the source file for the conversion, i.e. the document to be processed. This must be an absolute path to a local file.
Lets you just preprocess the source file using XSLT and write the result to a file. For this to work, you need to set the following global properties beforehand: XSLTProcessor and PreprocessingSheet. Optionally, you may pass parameters to the XSLT by setting the global parameter XSLTParameters, which should follow the pattern [name '=' '"' value '"']? [ '[;,]' name '=' '"' value '"' ]* .
The sequence of options is significant! Consider each of them directly resulting in the internal corresponding action as when you were to perform it programmatically via the API.
java -cp downcast.jar de.infinityloop.downcast.DowncastCmdline \ -debug true \ -license "C:\Documents and Settings\il\downcast.license" \ -downcastengine "CmdLine" \ -setglobalparameter outputDir "C:\Documents and Settings\il\output" \ -convertfile "C:\Documents and Settings\il\test.xml"
This calls the commandline interface and converts the document C:\Documents and Settings\il\test.xml to C:\Documents and Settings\il\output\test.rtf.
A commandfile is a plain text file consisting of one complete option (incl. parameters) per line. Commands can be indented for better legibility. Lines starting with a semicolon are considered comments. Parameter values defined on the commandline via the -param option can be referenced using the downCast default variable referencing syntax ${paramname}.
An example says more than 100 words - a look at the following sample commandfile will make everything clear:
Example 10.1. CLI Commandfile example
This converts a single document to RTF. The name of the sourcefile is passed by way of the -param option to the commandfile as variable.
The call would look like this (in one line):
java -cp downcast.jar de.infinityloop.downcast.DowncastCmdline -param destpath "/cli/out/" -param infile "/cli/in/test.xml" -commandfile "/cli/commands.txt"
commands.txt would then have contents similar to the following:
; For debugging output, set the following to true -debug false ; Set license -license "/cli/downcast.license" ; Create downCast Engine -downcastengine MyEngine; ; Where should the results go? -setglobalparameter outputDir ${destpath} ; ; Set some other conversion parameters ; Post-conversion to .doc binary format: -setglobalparameter ConvertToDoc "true" ; set to false if you want to keep temporary files: -setglobalparameter DeleteTemporaryFile "true" ; ; Finally: Convert! -convertfile ${infile}