public final class DocFormat extends DocumentFormat<DocMetadata,DocMetadataProperty,DocumentInfo> implements IInspectable<DocInspectionResult,DocInspectionOptions>, IProtectableFormat, ISignedFormat
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 . |
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
true if document contains DigitalSignature . |
DocInspectionResult |
inspectDocument()
Inspects the document and returns hidden data presented in document.
|
boolean |
isProtected()
Returns true if the 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, setProperties
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.
Value: The file type.getFileType
in class DocumentFormat<DocMetadata,DocMetadataProperty,DocumentInfo>
public final boolean isProtected()
Returns true if the document is encrypted and requires a password to open.
Value:true
if document is protected; otherwise, false
.isProtected
in interface IProtectableFormat
public final boolean hasDigitalSignatures()
Gets true
if document contains DigitalSignature
.
hasDigitalSignatures
in interface ISignedFormat
GroupDocsException
- Could not read digital signatures.
Value:
true
if document has digital signatures; otherwise, false
.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.com.aspose.ms.System.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.
com.aspose.ms.System.ArgumentNullException
- Inspection options could not be null.Copyright © 2017. All rights reserved.