PresentationInfo

Inheritance: java.lang.Object

All Implemented Interfaces: com.aspose.slides.IPresentationInfo

public final class PresentationInfo implements IPresentationInfo

Information about presentation file

Methods

MethodDescription
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:

ParameterTypeDescription
passwordjava.lang.StringThe 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:

ParameterTypeDescription
passwordjava.lang.StringThe password to check.

  1. 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:

ParameterTypeDescription
documentPropertiesIDocumentProperties

writeBindedPresentation(OutputStream stream)

public final void writeBindedPresentation(OutputStream stream)

Writes binded presentation to stream.

Parameters:

ParameterTypeDescription
streamjava.io.OutputStreamThe stream must be seekable and writable.

writeBindedPresentation(String file)

public final void writeBindedPresentation(String file)

Writes binded presentation to file.

Parameters:

ParameterTypeDescription
filejava.lang.StringPresentation file.