Class Converter

All Implemented Interfaces:
Converter
Direct Known Subclasses:
Html5Converter, Xhtml10Converter, Xhtml11Converter, XhtmlMathMLConverter

public class Converter extends ConverterBase

This class converts an OpenDocument file to an XHTML(+MathML) or EPUB document.

  • Field Details

    • nType

      protected int nType
  • Constructor Details

    • Converter

      public Converter(int nType)
  • Method Details

    • getConfig

      public Config getConfig()
      Description copied from interface: Converter
      Get the interface for the configuration of this converter
      Returns:
      the configuration
    • getXhtmlConfig

      protected XhtmlConfig getXhtmlConfig()
    • readTemplate

      public void readTemplate(InputStream is) throws IOException
      Description copied from interface: Converter
      Read a template to use as a base for the converted document. The format of the template depends on the Converter implementation.
      Specified by:
      readTemplate in interface Converter
      Overrides:
      readTemplate in class ConverterBase
      Parameters:
      is - an InputStream from which to read the template
      Throws:
      IOException - if some exception occurs while reading the template
    • readTemplate

      public void readTemplate(File file) throws IOException
      Description copied from interface: Converter
      Read a template to use as a base for the converted document. The format of the template depends on the Converter implementation.
      Specified by:
      readTemplate in interface Converter
      Overrides:
      readTemplate in class ConverterBase
      Parameters:
      file - a file from which to read the template
      Throws:
      IOException - if the file does not exist or some exception occurs while reading the template
    • readStyleSheet

      public void readStyleSheet(InputStream is) throws IOException
      Description copied from interface: Converter
      Read a style sheet to include with the converted document. The format of the style sheet depends on the Converter implementation.
      Specified by:
      readStyleSheet in interface Converter
      Overrides:
      readStyleSheet in class ConverterBase
      Parameters:
      is - an InputStream from which to read the style sheet
      Throws:
      IOException - if some exception occurs while reading the style sheet
    • readStyleSheet

      public void readStyleSheet(File file) throws IOException
      Description copied from interface: Converter
      Read a style sheet to include with the converted document. The format of the style sheet depends on the Converter implementation.
      Specified by:
      readStyleSheet in interface Converter
      Overrides:
      readStyleSheet in class ConverterBase
      Parameters:
      file - a file from which to read the style sheet
      Throws:
      IOException - if the file does not exist or some exception occurs while reading the style sheet
    • readResource

      public void readResource(InputStream is, String sFileName, String sMediaType) throws IOException
      Description copied from interface: Converter
      Read a resource to include with the converted document. A resource can be any (binary) file and will be placed in the same directory as the style sheet
      Specified by:
      readResource in interface Converter
      Overrides:
      readResource in class ConverterBase
      Parameters:
      is - an InputStream from which to read the resource
      sFileName - the file name to use for the resource
      sMediaType - the media type of the resource, if null the media type will be guessed from the file name
      Throws:
      IOException - if some exception occurs while reading the resource
    • readResource

      public void readResource(File file, String sFileName, String sMediaType) throws IOException
      Description copied from interface: Converter
      Read a style sheet to include with the converted document. A resource can be any (binary) file and will be placed in the same directory as the style sheet
      Specified by:
      readResource in interface Converter
      Overrides:
      readResource in class ConverterBase
      Parameters:
      file - a file from which to read the style sheet
      sFileName - the file name to use for the resource
      sMediaType - the media type of the resource, if null the media type will be guessed from the file name
      Throws:
      IOException - if the file does not exist or some exception occurs while reading the resource
    • getContentWidth

      protected String getContentWidth()
    • pushContentWidth

      protected String pushContentWidth(String sWidth)
    • popContentWidth

      protected void popContentWidth()
    • isTopLevel

      protected boolean isTopLevel()
    • getStyleCv

      protected writer2latex.xhtml.StyleConverter getStyleCv()
    • getTextCv

      protected TextConverter getTextCv()
    • getTableCv

      protected TableConverter getTableCv()
    • getDrawCv

      protected DrawConverter getDrawCv()
    • getMathCv

      protected MathConverter getMathCv()
    • getType

      protected int getType()
    • getOutFileIndex

      protected int getOutFileIndex()
    • addContentEntry

      protected void addContentEntry(String sTitle, int nLevel, String sTarget)
    • setTocFile

      protected void setTocFile(String sTarget)
    • setLofFile

      protected void setLofFile(String sTarget)
    • setLotFile

      protected void setLotFile(String sTarget)
    • setIndexFile

      protected void setIndexFile(String sTarget)
    • setCoverFile

      protected void setCoverFile(String sTarget)
    • setCoverImageFile

      protected void setCoverImageFile(OutputFile file, String sTarget)
    • createElement

      protected Element createElement(String s)
    • createTextNode

      protected Text createTextNode(String s)
    • importNode

      protected Node importNode(Node node, boolean bDeep)
    • getL10n

      protected L10n getL10n()
    • setOPS

      public void setOPS(boolean b)
    • isOPS

      public boolean isOPS()
    • convertInner

      public void convertInner() throws IOException
      Specified by:
      convertInner in class ConverterBase
      Throws:
      IOException
    • getPlainInlineText

      protected String getPlainInlineText(Node node)
    • handleOfficeAnnotation

      public void handleOfficeAnnotation(Node onode, Node hnode)
    • getOutFileName

      public String getOutFileName(int nIndex, boolean bWithExt)
    • outFileHasContent

      public boolean outFileHasContent()
    • changeOutFile

      public void changeOutFile(int nIndex)
    • getPanelNode

      public Element getPanelNode()
    • nextOutFile

      public Element nextOutFile()
    • createTarget

      public Element createTarget(String sId)
    • addTarget

      public void addTarget(Element node, String sId)
    • createLink

      public Element createLink(String sId)
    • createLink

      public Element createLink(Element onode)