public class Converter extends ConverterBase
This class converts an OpenDocument file to an XHTML(+MathML) or EPUB document.
ConverterBase.TexMathsStyle
Modifier and Type | Field and Description |
---|---|
protected int |
nType |
converterResult, graphicConverter, imageConverter, metaData, odDoc, ofr, sTargetFileName
Constructor and Description |
---|
Converter(int nType) |
Modifier and Type | Method and Description |
---|---|
protected void |
addContentEntry(java.lang.String sTitle,
int nLevel,
java.lang.String sTarget) |
void |
addEpubNs(org.w3c.dom.Element elm) |
void |
addEpubType(org.w3c.dom.Element elm,
java.lang.String sType) |
void |
addTarget(org.w3c.dom.Element node,
java.lang.String sId) |
void |
changeOutFile(int nIndex) |
void |
convertInner() |
protected org.w3c.dom.Element |
createElement(java.lang.String s) |
org.w3c.dom.Element |
createLink(org.w3c.dom.Element onode) |
org.w3c.dom.Element |
createLink(java.lang.String sId) |
org.w3c.dom.Element |
createTarget(java.lang.String sId) |
protected org.w3c.dom.Text |
createTextNode(java.lang.String s) |
Config |
getConfig()
Get the interface for the configuration of this converter
|
protected java.lang.String |
getContentWidth() |
protected DrawConverter |
getDrawCv() |
protected L10n |
getL10n() |
protected MathConverter |
getMathCv() |
protected int |
getOutFileIndex() |
java.lang.String |
getOutFileName(int nIndex,
boolean bWithExt) |
org.w3c.dom.Element |
getPanelNode() |
protected java.lang.String |
getPlainInlineText(org.w3c.dom.Node node) |
protected writer2latex.xhtml.StyleConverter |
getStyleCv() |
protected TableConverter |
getTableCv() |
protected TextConverter |
getTextCv() |
protected int |
getType() |
protected XhtmlConfig |
getXhtmlConfig() |
void |
handleOfficeAnnotation(org.w3c.dom.Node onode,
org.w3c.dom.Node hnode) |
protected org.w3c.dom.Node |
importNode(org.w3c.dom.Node node,
boolean bDeep) |
boolean |
isHTML5() |
boolean |
isOPS() |
protected boolean |
isTopLevel() |
org.w3c.dom.Element |
nextOutFile() |
boolean |
outFileHasContent() |
protected void |
popContentWidth() |
protected java.lang.String |
pushContentWidth(java.lang.String sWidth) |
void |
readResource(java.io.File file,
java.lang.String sFileName,
java.lang.String sMediaType)
Read a style sheet to include with the converted document.
|
void |
readResource(java.io.InputStream is,
java.lang.String sFileName,
java.lang.String sMediaType)
Read a resource to include with the converted document.
|
void |
readStyleSheet(java.io.File file)
Read a style sheet to include with the converted document.
|
void |
readStyleSheet(java.io.InputStream is)
Read a style sheet to include with the converted document.
|
void |
readTemplate(java.io.File file)
Read a template to use as a base for the converted document.
|
void |
readTemplate(java.io.InputStream is)
Read a template to use as a base for the converted document.
|
protected void |
setCoverFile(java.lang.String sTarget) |
protected void |
setCoverImageFile(OutputFile file,
java.lang.String sTarget) |
protected void |
setIndexFile(java.lang.String sTarget) |
protected void |
setLofFile(java.lang.String sTarget) |
protected void |
setLotFile(java.lang.String sTarget) |
void |
setOPS(boolean b) |
protected void |
setTocFile(java.lang.String sTarget) |
addDocument, convert, convert, convert, getEmbeddedObject, getImageCv, getMetaData, getTexMathsEquation, getTexMathsEquation, getTexMathsStyle, setGraphicConverter
public Config getConfig()
Converter
protected XhtmlConfig getXhtmlConfig()
public void readTemplate(java.io.InputStream is) throws java.io.IOException
Converter
Converter
implementation.readTemplate
in interface Converter
readTemplate
in class ConverterBase
is
- an InputStream
from which to read the templatejava.io.IOException
- if some exception occurs while reading the templatepublic void readTemplate(java.io.File file) throws java.io.IOException
Converter
Converter
implementation.readTemplate
in interface Converter
readTemplate
in class ConverterBase
file
- a file from which to read the templatejava.io.IOException
- if the file does not exist or some exception occurs
while reading the templatepublic void readStyleSheet(java.io.InputStream is) throws java.io.IOException
Converter
Converter
implementation.readStyleSheet
in interface Converter
readStyleSheet
in class ConverterBase
is
- an InputStream
from which to read the style sheetjava.io.IOException
- if some exception occurs while reading the style sheetpublic void readStyleSheet(java.io.File file) throws java.io.IOException
Converter
Converter
implementation.readStyleSheet
in interface Converter
readStyleSheet
in class ConverterBase
file
- a file from which to read the style sheetjava.io.IOException
- if the file does not exist or some exception occurs
while reading the style sheetpublic void readResource(java.io.InputStream is, java.lang.String sFileName, java.lang.String sMediaType) throws java.io.IOException
Converter
readResource
in interface Converter
readResource
in class ConverterBase
is
- an InputStream
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 namejava.io.IOException
- if some exception occurs while reading the resourcepublic void readResource(java.io.File file, java.lang.String sFileName, java.lang.String sMediaType) throws java.io.IOException
Converter
readResource
in interface Converter
readResource
in class ConverterBase
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 namejava.io.IOException
- if the file does not exist or some exception occurs
while reading the resourceprotected java.lang.String getContentWidth()
protected java.lang.String pushContentWidth(java.lang.String sWidth)
protected void popContentWidth()
protected boolean isTopLevel()
protected writer2latex.xhtml.StyleConverter getStyleCv()
protected TextConverter getTextCv()
protected TableConverter getTableCv()
protected DrawConverter getDrawCv()
protected MathConverter getMathCv()
protected int getType()
public boolean isHTML5()
protected int getOutFileIndex()
protected void addContentEntry(java.lang.String sTitle, int nLevel, java.lang.String sTarget)
protected void setTocFile(java.lang.String sTarget)
protected void setLofFile(java.lang.String sTarget)
protected void setLotFile(java.lang.String sTarget)
protected void setIndexFile(java.lang.String sTarget)
protected void setCoverFile(java.lang.String sTarget)
protected void setCoverImageFile(OutputFile file, java.lang.String sTarget)
protected org.w3c.dom.Element createElement(java.lang.String s)
protected org.w3c.dom.Text createTextNode(java.lang.String s)
protected org.w3c.dom.Node importNode(org.w3c.dom.Node node, boolean bDeep)
protected L10n getL10n()
public void setOPS(boolean b)
public boolean isOPS()
public void convertInner() throws java.io.IOException
convertInner
in class ConverterBase
java.io.IOException
protected java.lang.String getPlainInlineText(org.w3c.dom.Node node)
public void handleOfficeAnnotation(org.w3c.dom.Node onode, org.w3c.dom.Node hnode)
public java.lang.String getOutFileName(int nIndex, boolean bWithExt)
public boolean outFileHasContent()
public void changeOutFile(int nIndex)
public org.w3c.dom.Element getPanelNode()
public org.w3c.dom.Element nextOutFile()
public void addEpubNs(org.w3c.dom.Element elm)
public void addEpubType(org.w3c.dom.Element elm, java.lang.String sType)
public org.w3c.dom.Element createTarget(java.lang.String sId)
public void addTarget(org.w3c.dom.Element node, java.lang.String sId)
public org.w3c.dom.Element createLink(java.lang.String sId)
public org.w3c.dom.Element createLink(org.w3c.dom.Element onode)