public class FileFormatInfo
extends java.lang.Object
FileFormatUtil document format detection methods.
To learn more, visit the Detect File Format and Check Format Compatibility documentation article.
You do not create instances of this class directly. Objects of this class are returned by M:Aspose.Words.FileFormatUtil.DetectFileFormat(System.IO.Stream) methods.
| Modifier and Type | Method and Description |
|---|---|
java.nio.charset.Charset |
getEncoding()
Gets the detected encoding if applicable to the current document format.
|
int |
getLoadFormat()
Gets the detected document format.
|
boolean |
hasDigitalSignature()
Returns true if this document contains a digital signature.
|
boolean |
isEncrypted()
Returns true if the document is encrypted and requires a password to open.
|
public int getLoadFormat()
When an OOXML document is encrypted, it is not possible to ascertained whether it is an Excel, Word or PowerPoint document without decrypting it first so for an encrypted OOXML document this property will always return LoadFormat.DOCX.
LoadFormat constants.isEncrypted()public boolean isEncrypted()
This property exists to help you sort documents that are encrypted from those that are not. If you attempt to load an encrypted document using Aspose.Words without supplying a password an exception will be thrown. You can use this property to detect whether a document requires a password and take some action before loading a document, for example, prompt the user for a password.
getLoadFormat()public boolean hasDigitalSignature()
This property exists to help you sort documents that are digitally signed from those that are not. If you use Aspose.Words to modify and save a document that is digitally signed, then the digital signature will be lost. This is by design because a digital signature exists to guard the authenticity of a document. Using this property you can detect digitally signed documents before processing them in the same way as normal documents and take some action to avoid losing the digital signature, for example notify the user.
public java.nio.charset.Charset getEncoding()