Class Mcf2FoConverter

java.lang.Object
be.gaudry.model.image.cewe.Mcf2FoConverter

public class Mcf2FoConverter extends Object
The core class to convert MCF files to XSL-FO data (which then can be used to render page based documents, e.g. PDF files).
  • Constructor Details

    • Mcf2FoConverter

      public Mcf2FoConverter(AbstractBrolWorker<Integer> bgw, File mcfInstallDir, File mcfTempDir, File tempImageDir) throws IOException, SAXException
      Creates a new converter object with given settings.
      Parameters:
      bgw - background worker to report progress information
      mcfInstallDir - The installation directory of the MCF Software.
      mcfTempDir - The temporary directory of the MCF Software to use. This is normally <USER_HOME>/.mcf.
      tempImageDir - The temporary directory to use for storing image files (created by this converter object). This directory is created if it does not exist.
      Throws:
      IOException - If any I/O problem occurs when reading files in the installation directory, or the temporary directory could not be created.
      SAXException - If any of the XML files in the installation directory which are parsed have a format error.
  • Method Details

    • convert

      public void convert(File mcfFile, OutputStream xslFoOut, int dpi, boolean binding, int maxPageNo) throws IOException, SAXException
      Performs conversion of the given MCF input file to XSL-FO data.
      Parameters:
      mcfFile - MCF input file.
      xslFoOut - Stream to write the XSL-FO data to.
      dpi - Resolution, in dots per inch, to use for image rendering. The higher the value, the better the quality, but the more RAM is consumed.
      binding - true to add a page separation
      maxPageNo - Renders only up to the given page number (e.g. for testing settings). A value of -1 indicates to render all pages.
      Throws:
      IOException - If any I/O related problem occurs, e.g. reading the input file or any referenced image files.
      SAXException - If any XML related problem occurs, e.g. the input file has an invalid format.