This first sample consists in a single step: invoke XMLmind XSL-FO Converter to convert the XSL-FO input file to RTF.
Note that converting XSL-FO to other formats is simply a matter of changing the value of the outputFormat
property. The possible values for this property are: rtf
, wml
, docx
, odt
.
Excerpts of samples/java/Sample1.java
:
import org.xml.sax.InputSource; import com.xmlmind.fo.converter.OutputDestination; import com.xmlmind.fo.converter.Converter; ... Converter converter = new Converter();converter.setProperty("outputFormat", "rtf");
converter.setProperty("outputEncoding", "Cp1252"); converter.setProperty("imageResolution", "120"); InputSource src = new InputSource(inFile.toURI().toASCIIString());
OutputDestination dst = new OutputDestination(outFile.getPath());
converter.convert(src, dst);
...
Create a new Converter object. | ||||
Parameterize the Note that specifying property | ||||
Specify the input source of the Here we use the most high-level specification: we specify an URL. In production, you'll generally specify an | ||||
Specify the output destination of the Here we use the most high-level specification: we specify an
| ||||
Perform the conversion by invoking Converter.convert. |