public final class DocFormat extends DocumentFormat<DocMetadata,DocMetadataProperty,DocumentInfo> implements IInspectable<DocInspectionResult,DocInspectionOptions>, IProtectableFormat, ISignedFormat, IDublinCore
Represents MS Word format.
filePath, stream
Constructor and Description |
---|
DocFormat(InputStream input)
Initializes a new instance of the
DocFormat class. |
DocFormat(String fileName)
Initializes a new instance of the
DocFormat class. |
Modifier and Type | Method and Description |
---|---|
void |
cleanMetadata()
Removes custom document properties and reset built-in properties.
|
void |
clearComments()
Removes all comments presented in Word document.
|
void |
clearCustomProperties()
Removes all custom document properties in
DocFormat . |
DocComment[] |
extractComments()
Extract array of
DocComment presented in Word document. |
DocComment[] |
extractComments(String author)
Extracts array of
DocComment presented in Word document by specific author. |
DocMetadata |
getDocumentProperties()
Gets the document properties in
DocFormat . |
DublinCoreMetadata |
getDublinCore()
Gets Dublin Core metadata.
|
int |
getFileType()
Gets the file type like DOC, DOCX, DOTX.
|
int |
getPagesCount()
Returns number of words presented in document.
|
RevisionCollection |
getRevisions()
Gets a collection of revisions (tracked changes) that exist in this document.
|
int |
getType()
Gets document type.
|
int |
getWordsCount()
Returns number of words presented in document.
|
boolean |
hasDigitalSignatures()
Gets a value indicating whether document contains
DigitalSignature . |
DocInspectionResult |
inspectDocument()
Inspects the document and returns hidden data presented in document.
|
boolean |
isProtected()
Gets a value indicating whether document is encrypted and requires a password to open.
|
void |
removeHiddenData(DocInspectionOptions options)
Removes the hidden data.
|
void |
updateComment(int updatingCommentId,
DocComment comment)
Updates the specific comment by id.
|
clearBuiltInProperties, extractDocumentProperties, getDocumentInfo, getThumbnail, readDocumentPropertyByKey, readPropertyByName, readThumbnail, setProperties
close, dispose, getMetadata, getMIMEType, readByMetadataKey, save, save, save
public DocFormat(String fileName)
Initializes a new instance of the DocFormat
class.
fileName
- Absolute path to the file.public DocFormat(InputStream input)
Initializes a new instance of the DocFormat
class.
input
- File stream.public int getType()
Gets document type.
getType
in class FormatBase
public DocMetadata getDocumentProperties()
Gets the document properties in DocFormat
.
getDocumentProperties
in class DocumentFormat<DocMetadata,DocMetadataProperty,DocumentInfo>
public int getFileType()
Gets the file type like DOC, DOCX, DOTX.
getFileType
in class DocumentFormat<DocMetadata,DocMetadataProperty,DocumentInfo>
public final boolean isProtected()
Gets a value indicating whether document is encrypted and requires a password to open.
isProtected
in interface IProtectableFormat
true
if document is protected; otherwise, false
.public final boolean hasDigitalSignatures()
Gets a value indicating whether document contains DigitalSignature
.
hasDigitalSignatures
in interface ISignedFormat
true
if document has digital signatures; otherwise, false
.GroupDocsException
- Could not read digital signatures.
Value:
true
if document has digital signatures; otherwise, false
.public final DublinCoreMetadata getDublinCore()
Gets Dublin Core metadata.
getDublinCore
in interface IDublinCore
DublinCoreMetadata
if Dublin Core metadata is presented; otherwise null.
public void cleanMetadata()
Removes custom document properties and reset built-in properties.
cleanMetadata
in class FormatBase
public final DocComment[] extractComments()
Extract array of DocComment
presented in Word document.
DocComment
.
public final DocComment[] extractComments(String author)
Extracts array of DocComment
presented in Word document by specific author.
author
- Name of the author.
DocComment
.public final void clearComments()
Removes all comments presented in Word document.
public final void updateComment(int updatingCommentId, DocComment comment)
Updates the specific comment by id.
updatingCommentId
- The updating comment identifier.comment
- The comment.com.aspose.ms.System.ArgumentOutOfRangeException
- Comment id could not be less zero.ArgumentNullException
- Comment could not be null.GroupDocsException
- Could not update comment.public final RevisionCollection getRevisions()
Gets a collection of revisions (tracked changes) that exist in this document.
public void clearCustomProperties()
Removes all custom document properties in DocFormat
.
clearCustomProperties
in class DocumentFormat<DocMetadata,DocMetadataProperty,DocumentInfo>
public final int getWordsCount()
Returns number of words presented in document.
public final int getPagesCount()
Returns number of words presented in document.
public final DocInspectionResult inspectDocument()
Inspects the document and returns hidden data presented in document.
inspectDocument
in interface IInspectable<DocInspectionResult,DocInspectionOptions>
DocInspectionResult
.
public final void removeHiddenData(DocInspectionOptions options)
Removes the hidden data.
removeHiddenData
in interface IInspectable<DocInspectionResult,DocInspectionOptions>
options
- Inspection options.
ArgumentNullException
- Inspection options could not be null.Copyright © 2018. All rights reserved.