Class EPUBWriter

java.lang.Object
writer2latex.epub.EPUBWriter
All Implemented Interfaces:
OutputFile

public class EPUBWriter extends Object implements OutputFile
This class repackages an XHTML document into EPUB format. Some filenames are hard wired in this implementation: The main directory is OEBPS and the OPF and NCX files are book.opf and book.ncx respectively; finally the EPUB 3 navigation document is nav.xhtml
  • Constructor Details

    • EPUBWriter

      public EPUBWriter(ConverterResult xhtmlResult, String sFileName, int nVersion, XhtmlConfig config)
      Create a new EPUBWriter based on a ConverterResult.
      Parameters:
      xhtmlResult - the converter result to repackage
      sFileName - the file name to use for the result
      nVersion - the EPUB version number. Can be either 2 or 3, other values are interpreted as 2.
      config - the configuration to use
  • Method Details

    • getFileName

      public String getFileName()
      Description copied from interface: OutputFile
      Returns the file name of the OutputFile. This includes the file extension and may also include a relative path, always using / as separator.
      Specified by:
      getFileName in interface OutputFile
      Returns:
      the file name of this OutputFile
    • getMIMEType

      public String getMIMEType()
      Description copied from interface: OutputFile
      Get the MIME type of the OutputFile.
      Specified by:
      getMIMEType in interface OutputFile
      Returns:
      string representation of the MIME type
    • isMasterDocument

      public boolean isMasterDocument()
      Description copied from interface: OutputFile
      Test whether this document is part of the main document flow (master documents) or an auxiliary document
      Specified by:
      isMasterDocument in interface OutputFile
      Returns:
      true if this document is a master document
    • containsMath

      public boolean containsMath()
      Description copied from interface: OutputFile
      Test whether this document contains mathematical formulas
      Specified by:
      containsMath in interface OutputFile
      Returns:
      true if the document contains formulas
    • write

      public void write(OutputStream os) throws IOException
      Description copied from interface: OutputFile
      Writes the OutputFile to an OutputStream.
      Specified by:
      write in interface OutputFile
      Parameters:
      os - OutputStream to which the content should be written
      Throws:
      IOException - if any I/O error occurs