public class OdfImageDocument extends OdfDocument
Modifier and Type | Class and Description |
---|---|
static class |
OdfImageDocument.OdfMediaType
This enum contains all possible media types of OdfImageDocument documents.
|
OdfDocument.UnicodeGroup
OdfSchemaDocument.OdfXMLFile
OdfPackageDocument.Resource
mContentDom, mDocumentStyles, mMetaDom, mSettingsDom, mStylesDom
mDocumentMediaType, mDocumentPathInPackage, mPackage, ROOT_DOCUMENT_PATH
Modifier | Constructor and Description |
---|---|
protected |
OdfImageDocument(OdfPackage pkg,
String internalPath,
OdfImageDocument.OdfMediaType odfMediaType)
To avoid data duplication a new document is only created, if not already opened.
|
Modifier and Type | Method and Description |
---|---|
void |
changeMode(OdfImageDocument.OdfMediaType mediaType)
Changes the document to the given mediatype.
|
OfficeImageElement |
getContentRoot()
Get the content root of a image document.
|
static OdfImageDocument |
loadDocument(File file)
Creates an OdfImageDocument from the OpenDocument provided by a File.
|
static OdfImageDocument |
loadDocument(InputStream inputStream)
Creates an OdfImageDocument from the OpenDocument provided by a resource Stream.
|
static OdfImageDocument |
loadDocument(String documentPath)
Loads an OdfImageDocument from the provided path.
|
static OdfImageDocument |
newImageDocument()
Creates an empty image document.
|
static OdfImageDocument |
newImageTemplateDocument()
Creates an empty image template.
|
close, getLocale, getOdfMediaType, getOfficeMetadata, getTableByName, getTableList, getUnicodeGroup, loadDocument, loadDocument, loadSubDocument, loadSubDocuments, loadSubDocuments, loadTemplate, newImage, save, save, setLocale, setOdfMediaType, toString
getBaseURI, getBookmarkRDFMetadata, getContentDom, getContentStream, getDocumentStyles, getFileDom, getInContentMetadata, getInContentMetadataFromCache, getManifestRDFMetadata, getMasterPages, getMetaDom, getMetaStream, getOfficeMasterStyles, getOrCreateDocumentStyles, getRDFMetadata, getSettingsDom, getSettingsStream, getStylesDom, getStylesStream, getTables, getXMLFilePath
flushDoms, getDocumentPath, getFileDom, getMediaTypeString, getPackage, getXMLFileMetadata, insertDocument, isExternalReference, isRootDocument, normalizeDocumentPath, removeDocument, save, setMediaTypeString
protected OdfImageDocument(OdfPackage pkg, String internalPath, OdfImageDocument.OdfMediaType odfMediaType) throws SAXException
SAXException
public static OdfImageDocument newImageDocument() throws Exception
Exception
- - if the document could not be createdpublic static OdfImageDocument newImageTemplateDocument() throws Exception
Exception
- - if the template could not be createdpublic static OdfImageDocument loadDocument(InputStream inputStream) throws Exception
Since an InputStream does not provide the arbitrary (non sequentiell) read access needed by OdfImageDocument, the InputStream is cached. This usually takes more time compared to the other createInternalDocument methods. An advantage of caching is that there are no problems overwriting an input file.
If the resource stream is not a ODF image document, ClassCastException might be thrown.
inputStream
- - the InputStream of the ODF image document.Exception
- - if the document could not be created.public static OdfImageDocument loadDocument(String documentPath) throws Exception
OdfImageDocument relies on the file being available for read access over the whole lifecycle of OdfImageDocument.
If the resource stream is not a ODF image document, ClassCastException might be thrown.
documentPath
- - the path from where the document can be loadedException
- - if the document could not be created.public static OdfImageDocument loadDocument(File file) throws Exception
OdfImageDocument relies on the file being available for read access over the whole lifecycle of OdfImageDocument.
If the resource stream is not a ODF image document, ClassCastException might be thrown.
file
- - a file representing the ODF image document.Exception
- - if the document could not be created.public OfficeImageElement getContentRoot() throws Exception
getContentRoot
in class OdfDocument
Exception
- if the file DOM could not be created.public void changeMode(OdfImageDocument.OdfMediaType mediaType)
mediaType
- the related ODF mimetypeCopyright © 2008–2018 Apache Software Foundation; Copyright © 2018–2019 The Document Foundation. All rights reserved.