AurigaDoc converter utility can be used from the a java class be following the steps given below:-
- Add all jars in AURIGADOC_HOME/lib to your classpath.
- Add the AURIGADOC_HOME/bin directory to your classpath.
- Invoke the AurigaDoc converter using the following code snippet
A simple example
import com.aurigalogic.aurigadoc.core.Driver;
import com.aurigalogic.aurigadoc.logger.DefaultLogger; // for logging
.
.
Driver driver = new Driver(); // instantiate the driver
driver.setInputFile(inputFile); // set the input file path
driver.setOutputFile(outputFile); // set the output file/dir path
driver.setFormat(Driver.FORMAT_HTML); // set the output format
driver.setLogger(new DefaultLogger()); // set the logger (optional)
driver.run(); // run the driver
Example of invoking AurigaDoc with a custom xsl
import com.aurigalogic.aurigadoc.core.Driver;
import com.aurigalogic.aurigadoc.logger.DefaultLogger; // for logging
import com.aurigalogic.aurigadoc.code.HTMLConverter; // for logging
.
.
Driver driver = new Driver(); // instantiate the driver
driver.setInputFile(inputFile); // set the input file path
driver.setOutputFile(outputFile); // set the output file/dir path
driver.setFormat(Driver.FORMAT_HTML); // set the output format
driver.setLogger(new DefaultLogger()); // set the logger (optional)
Properties params = new Properties(); // converter parameters
params.setProperty(HTMLConverter.XSL, "path-to-my-custom-xsl");
driver.setParameters(params);
driver.run(); // run the driver