public interface IPresentationInfo
Information about presentation file
Modifier and Type | Method and Description |
---|---|
boolean |
checkPassword(java.lang.String password)
Checks whether a password is correct for a presentation protected with open password.
|
boolean |
checkWriteProtection(java.lang.String password)
Checks whether a password to modify is correct for a write protected presentation.
|
int |
getLoadFormat()
Gets format of the binded presentation.
|
boolean |
isEncrypted()
Gets True if binded presentation is encrypted, otherwise False.
|
boolean |
isPasswordProtected()
Gets a value that indicates whether a binded presentation is protected by a password to open.
|
byte |
isWriteProtected()
Gets a value that indicates whether a binded presentation is write protected.
|
IDocumentProperties |
readDocumentProperties()
Gets document properties of binded presentation.
|
void |
updateDocumentProperties(IDocumentProperties documentProperties)
Updates properties of binded presentation.
|
void |
writeBindedPresentation(java.io.OutputStream stream)
Writes binded presentation to stream.
|
void |
writeBindedPresentation(java.lang.String file)
Writes binded presentation to file.
|
boolean isEncrypted()
Gets True if binded presentation is encrypted, otherwise False.
Read-only boolean
.
boolean isPasswordProtected()
Gets a value that indicates whether a binded presentation is protected by a password to open.
IPresentationInfo info = PresentationFactory.getInstance().getPresentationInfo("pres.pptx"); if (info.isPasswordProtected()) { System.out.println("The presentation '" + presentationFilePath + "' is protected by a password to open."); }
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 write protected by a password."); }
NullableBool
enumeration.
int getLoadFormat()
Gets format of the binded presentation.
Read-only LoadFormat
.
boolean checkPassword(java.lang.String password)
Checks whether a password is correct for a presentation protected with open password.
IPresentationInfo info = PresentationFactory.getInstance().getPresentationInfo("pres.pptx"); boolean isPasswordCorrect = info.checkPassword("my_password");
password
- The password to check.
boolean checkWriteProtection(java.lang.String password)
Checks whether a password to modify is correct for a write protected presentation.
IPresentationInfo info = PresentationFactory.getInstance().getPresentationInfo("pres.pptx"); if (info.isWriteProtected() == NullableBool.True) { boolean isWriteProtectedByPassword = info.checkWriteProtection("my_password"); }
password
- The password to check.
isWriteProtected()
) property before calling this method.
2. When password is null or empty, this method returns false.
com.aspose.ms.System.InvalidOperationException
- If a presentation is protected by a password to open or format does not support write protectionIDocumentProperties readDocumentProperties()
Gets document properties of binded presentation.
IDocumentProperties
void updateDocumentProperties(IDocumentProperties documentProperties)
Updates properties of binded presentation.
This sample shows how to call theupdateDocumentProperties(IDocumentProperties)
method to update the document properties returned by call of thereadDocumentProperties()
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");
documentProperties
- Document properties IDocumentProperties
void writeBindedPresentation(java.io.OutputStream stream)
Writes binded presentation to stream.
stream
- The stream must be seekable and writable.void writeBindedPresentation(java.lang.String file)
Writes binded presentation to file.
file
- Presentation file.