public abstract class DocumentFormat<T extends DocumentMetadata<TK>,TK extends MetadataProperty,TDi extends DocumentInfo> extends FormatBase implements IDocumentFormat
Represents base abstraction for document formats such as PDF, WORD, EXCEL, PowerPoint.
T
: Represents DocumentMetadata{TK}
.
TK
: Represents MetadataProperty
.
TDi
: Represents GroupDocs.Metadata.DocumentInfo
.
Modifier and Type | Method and Description |
---|---|
void |
clearBuiltInProperties()
Resets built-in properties.
|
void |
clearCustomProperties()
Removes all custom document properties.
|
MetadataPropertyCollection |
extractDocumentProperties()
Extracts the document properties.
|
TDi |
getDocumentInfo()
Gets the document calculated info.
|
T |
getDocumentProperties()
Gets document properties
T presented in DocumentFormat{T,TK,DI} . |
int |
getFileType()
Gets the file type.
|
byte[] |
getThumbnail()
Gets the thumbnail of document in PNG format.
|
MetadataProperty |
readDocumentPropertyByKey(MetadataKey key) |
MetadataProperty |
readPropertyByName(String propertyName) |
ThumbnailMetadata |
readThumbnail()
Reads the thumbnail of the document in PNG format.
|
int |
setProperties(MetadataPropertyCollection properties)
Updates document properties.
|
cleanMetadata, close, dispose, dispose, getMetadata, getMIMEType, getType, readByMetadataKey, save, save, save
public T getDocumentProperties()
Gets document properties T
presented in DocumentFormat{T,TK,DI}
.
public int getFileType()
Gets the file type.
public final TDi getDocumentInfo()
Gets the document calculated info.
public final byte[] getThumbnail()
Gets the thumbnail of document in PNG format. Thumbnail is provided only for first page in document.
com.aspose.ms.System.NotSupportedException
- Reading of thumbnail is not supported for PptFormat and VisioFormat.GroupDocsException
- Could not read thumbnail.
Value:
The thumbnail.
public final MetadataPropertyCollection extractDocumentProperties()
Extracts the document properties.
extractDocumentProperties
in interface IDocumentFormat
MetadataPropertyCollection
public final int setProperties(MetadataPropertyCollection properties)
Updates document properties.
setProperties
in interface IDocumentFormat
properties
- Document properties.
ArgumentNullException
- Properties could not be null.public void clearBuiltInProperties()
Resets built-in properties.
public void clearCustomProperties()
Removes all custom document properties.
public final ThumbnailMetadata readThumbnail()
Reads the thumbnail of the document in PNG format.
ThumbnailMetadata
class containig thumbnail metadata (including image bytes).
public MetadataProperty readPropertyByName(String propertyName)
public MetadataProperty readDocumentPropertyByKey(MetadataKey key)
Copyright © 2019. All rights reserved.