PresentationInfo
Inheritance: java.lang.Object
All Implemented Interfaces: com.aspose.slides.IPresentationInfo
public final class PresentationInfo implements IPresentationInfo
Information about presentation file
Methods
Method | Description |
---|---|
isEncrypted() | Gets True if binded presentation is encrypted, otherwise False. |
isPasswordProtected() | Gets a value that indicates whether a binded presentation is protected by a password to open. |
isWriteProtected() | Gets a value that indicates whether a binded presentation is write protected. |
getLoadFormat() | Gets format of the binded presentation. |
checkPassword(String password) | Checks whether a password is correct for a presentation protected with open password. |
checkWriteProtection(String password) | Checks whether a password to modify is correct for a write protected presentation. |
readDocumentProperties() | Gets document properties of binded presentation. |
updateDocumentProperties(IDocumentProperties documentProperties) | Updates properties of binded presentation. |
writeBindedPresentation(OutputStream stream) | Writes binded presentation to stream. |
writeBindedPresentation(String file) | Writes binded presentation to file. |
isEncrypted()
public final boolean isEncrypted()
Gets True if binded presentation is encrypted, otherwise False. Read-only boolean.
Returns: boolean
isPasswordProtected()
public final boolean isPasswordProtected()
Gets a value that indicates whether a binded presentation is protected by a password to open.
IPresentationInfo info = PresentationFactory.getInstance().getPresentationInfo(presentationFilePath); if (info.isPasswordProtected()) { System.out.println("The presentation '" + presentationFilePath + "' is protected by password to open."); }
Returns: boolean
isWriteProtected()
public final byte isWriteProtected()
Gets a value that indicates whether a binded presentation is write protected.
IPresentationInfo info = PresentationFactory.getInstance().getPresentationInfo(presentationFilePath); if (info.isWriteProtected() == NullableBool.True) { System.out.println("The presentation '" + presentationFilePath + "' is protected by password to open."); }
If the presentation is protected by a password to open, the property value equals NotDefined.
Returns: byte
getLoadFormat()
public final int getLoadFormat()
Gets format of the binded presentation. Read-only LoadFormat.
Returns: int
checkPassword(String password)
public final boolean checkPassword(String password)
Checks whether a password is correct for a presentation protected with open password.
IPresentationInfo info = PresentationFactory.getInstance().getPresentationInfo(presentationFilePath); boolean isPasswordCorrect = info.checkPassword("my_password");
Parameters:
Parameter | Type | Description |
---|---|---|
password | java.lang.String | The password to check. |
When the password is null or empty, this method returns false. |
Returns: boolean - True if the presentation is protected with open password and the password is correct and false otherwise.
checkWriteProtection(String password)
public final boolean checkWriteProtection(String password)
Checks whether a password to modify is correct for a write protected presentation.
IPresentationInfo info = PresentationFactory.getInstance().getPresentationInfo(presentationFilePath); if (info.isWriteProtected() == NullableBool.True) { boolean isWriteProtectedByPassword = info.checkWriteProtection("my_password"); }
Parameters:
Parameter | Type | Description |
---|---|---|
password | java.lang.String | The password to check. |
- You should check the (#isWriteProtected.isWriteProtected) property before calling this method. 2. When password is null or empty, this method returns false. |
Returns: boolean - True if the presentation is write protected and the password is correct. False otherwise.
readDocumentProperties()
public final IDocumentProperties readDocumentProperties()
Gets document properties of binded presentation.
Returns: IDocumentProperties
updateDocumentProperties(IDocumentProperties documentProperties)
public final void updateDocumentProperties(IDocumentProperties documentProperties)
Updates properties of binded presentation.
This sample shows how to call the #updateDocumentProperties(IDocumentProperties).updateDocumentProperties(IDocumentProperties) method to update the document properties returned by call of the #readDocumentProperties.readDocumentProperties method. IPresentationInfo info = PresentationFactory.getInstance().getPresentationInfo("pres.pptx"); IDocumentProperties props = info.readDocumentProperties(); props.setSubject("New subject"); props.setLastSavedTime(Calendar.getInstance().getTime()); info.updateDocumentProperties(props); info.writeBindedPresentation("new_pres.pptx");
Parameters:
Parameter | Type | Description |
---|---|---|
documentProperties | IDocumentProperties |
writeBindedPresentation(OutputStream stream)
public final void writeBindedPresentation(OutputStream stream)
Writes binded presentation to stream.
Parameters:
Parameter | Type | Description |
---|---|---|
stream | java.io.OutputStream | The stream must be seekable and writable. |
writeBindedPresentation(String file)
public final void writeBindedPresentation(String file)
Writes binded presentation to file.
Parameters:
Parameter | Type | Description |
---|---|---|
file | java.lang.String | Presentation file. |