Package writer2latex.xhtml
Class Converter
java.lang.Object
writer2latex.base.ConverterBase
writer2latex.xhtml.Converter
- All Implemented Interfaces:
Converter
- Direct Known Subclasses:
Html5Converter
,Xhtml10Converter
,Xhtml11Converter
,XhtmlMathMLConverter
This class converts an OpenDocument file to an XHTML(+MathML) or EPUB document.
-
Nested Class Summary
Nested classes/interfaces inherited from class writer2latex.base.ConverterBase
ConverterBase.TexMathsStyle
-
Field Summary
FieldsFields inherited from class writer2latex.base.ConverterBase
converterResult, graphicConverter, imageConverter, metaData, odDoc, ofr, sTargetFileName
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
addContentEntry
(String sTitle, int nLevel, String sTarget) void
void
changeOutFile
(int nIndex) void
protected Element
createLink
(String sId) createLink
(Element onode) createTarget
(String sId) protected Text
Get the interface for the configuration of this converterprotected String
protected DrawConverter
protected L10n
getL10n()
protected MathConverter
protected int
getOutFileName
(int nIndex, boolean bWithExt) protected String
getPlainInlineText
(Node node) protected writer2latex.xhtml.StyleConverter
protected TableConverter
protected TextConverter
protected int
getType()
protected XhtmlConfig
void
handleOfficeAnnotation
(Node onode, Node hnode) protected Node
importNode
(Node node, boolean bDeep) boolean
isOPS()
protected boolean
boolean
protected void
protected String
pushContentWidth
(String sWidth) void
readResource
(File file, String sFileName, String sMediaType) Read a style sheet to include with the converted document.void
readResource
(InputStream is, String sFileName, String sMediaType) Read a resource to include with the converted document.void
readStyleSheet
(File file) Read a style sheet to include with the converted document.void
Read a style sheet to include with the converted document.void
readTemplate
(File file) Read a template to use as a base for the converted document.void
Read a template to use as a base for the converted document.protected void
setCoverFile
(String sTarget) protected void
setCoverImageFile
(OutputFile file, String sTarget) protected void
setIndexFile
(String sTarget) protected void
setLofFile
(String sTarget) protected void
setLotFile
(String sTarget) void
setOPS
(boolean b) protected void
setTocFile
(String sTarget) Methods inherited from class writer2latex.base.ConverterBase
addDocument, convert, convert, convert, getEmbeddedObject, getImageCv, getMetaData, getTexMathsEquation, getTexMathsEquation, getTexMathsStyle, setGraphicConverter
-
Field Details
-
nType
protected int nType
-
-
Constructor Details
-
Converter
public Converter(int nType)
-
-
Method Details
-
getConfig
Description copied from interface:Converter
Get the interface for the configuration of this converter- Returns:
- the configuration
-
getXhtmlConfig
-
readTemplate
Description copied from interface:Converter
Read a template to use as a base for the converted document. The format of the template depends on theConverter
implementation.- Specified by:
readTemplate
in interfaceConverter
- Overrides:
readTemplate
in classConverterBase
- Parameters:
is
- anInputStream
from which to read the template- Throws:
IOException
- if some exception occurs while reading the template
-
readTemplate
Description copied from interface:Converter
Read a template to use as a base for the converted document. The format of the template depends on theConverter
implementation.- Specified by:
readTemplate
in interfaceConverter
- Overrides:
readTemplate
in classConverterBase
- 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
Description copied from interface:Converter
Read a style sheet to include with the converted document. The format of the style sheet depends on theConverter
implementation.- Specified by:
readStyleSheet
in interfaceConverter
- Overrides:
readStyleSheet
in classConverterBase
- Parameters:
is
- anInputStream
from which to read the style sheet- Throws:
IOException
- if some exception occurs while reading the style sheet
-
readStyleSheet
Description copied from interface:Converter
Read a style sheet to include with the converted document. The format of the style sheet depends on theConverter
implementation.- Specified by:
readStyleSheet
in interfaceConverter
- Overrides:
readStyleSheet
in classConverterBase
- 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
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 interfaceConverter
- Overrides:
readResource
in classConverterBase
- Parameters:
is
- anInputStream
from which to read the resourcesFileName
- the file name to use for the resourcesMediaType
- 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
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 interfaceConverter
- Overrides:
readResource
in classConverterBase
- Parameters:
file
- a file from which to read the style sheetsFileName
- the file name to use for the resourcesMediaType
- 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
-
pushContentWidth
-
popContentWidth
protected void popContentWidth() -
isTopLevel
protected boolean isTopLevel() -
getStyleCv
protected writer2latex.xhtml.StyleConverter getStyleCv() -
getTextCv
-
getTableCv
-
getDrawCv
-
getMathCv
-
getType
protected int getType() -
getOutFileIndex
protected int getOutFileIndex() -
addContentEntry
-
setTocFile
-
setLofFile
-
setLotFile
-
setIndexFile
-
setCoverFile
-
setCoverImageFile
-
createElement
-
createTextNode
-
importNode
-
getL10n
-
setOPS
public void setOPS(boolean b) -
isOPS
public boolean isOPS() -
convertInner
- Specified by:
convertInner
in classConverterBase
- Throws:
IOException
-
getPlainInlineText
-
handleOfficeAnnotation
-
getOutFileName
-
outFileHasContent
public boolean outFileHasContent() -
changeOutFile
public void changeOutFile(int nIndex) -
getPanelNode
-
nextOutFile
-
createTarget
-
addTarget
-
createLink
-
createLink
-