task.getFofile().getParentFile().toURL().toExternalForm());
} catch (Exception e) {
task.log("Error setting base directory", Project.MSG_DEBUG);
}
InputHandler inputHandler = new FOInputHandler(task.getFofile());
XMLReader parser = inputHandler.getParser();
setParserFeatures(parser);
FileOutputStream pdfOut = null;
try {
pdfOut = new FileOutputStream(task.getPdffile());
} catch (Exception ex) {
MessageHandler.errorln("Failed to open " + task.getPdffile());
throw new BuildException(ex);
}
task.log("Using base directory: "
+ Configuration.getValue("baseDir"), Project.MSG_DEBUG);
task.log(task.getFofile().getName() + " -> "
+ task.getPdffile().getName(), Project.MSG_INFO);
try {
Driver driver = new Driver(inputHandler.getInputSource(), pdfOut);
driver.setRenderer(Driver.RENDER_PDF);
driver.setXMLReader(parser);
driver.run();
} catch (Exception ex) {
MessageHandler.logln("Error: " + ex.getMessage());