com.aspose.slides

Interfaces

Classes

Exceptions

com.aspose.slides

Class PresentationInfo

  • java.lang.Object
    • com.aspose.slides.PresentationInfo
  • All Implemented Interfaces:
    IPresentationInfo


    public final class PresentationInfo
    extends java.lang.Object
    implements IPresentationInfo

    Information about presentation file

    • Method Detail

      • isEncrypted

        public final boolean isEncrypted()

        Gets True if binded presentation is encrypted, otherwise False. Read-only boolean.

        Specified by:
        isEncrypted in interface IPresentationInfo
      • 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.");
         }
         
        Specified by:
        isPasswordProtected in interface IPresentationInfo
      • isWriteProtected

        public final byte isWriteProtected()

        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.");
         }
         
        Specified by:
        isWriteProtected in interface IPresentationInfo
      • checkWriteProtection

        public final boolean checkWriteProtection(java.lang.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");
         }
         
        Specified by:
        checkWriteProtection in interface IPresentationInfo
        Parameters:
        password - The 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:
        True if the presentation is write protected and the password is correct. False otherwise.
        Throws:
        com.aspose.ms.System.InvalidOperationException - If a presentation is protected by a password to open or format does not support write protection
      • updateDocumentProperties

        public final void updateDocumentProperties(IDocumentProperties documentProperties)

        Updates properties of binded presentation.


         This sample shows how to call the updateDocumentProperties(IDocumentProperties) method to
         update the document properties returned by call of the 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");
         
        Specified by:
        updateDocumentProperties in interface IPresentationInfo
      • writeBindedPresentation

        public final void writeBindedPresentation(java.io.OutputStream stream)

        Writes binded presentation to stream.

        Specified by:
        writeBindedPresentation in interface IPresentationInfo
        Parameters:
        stream - The stream must be seekable and writable.
      • writeBindedPresentation

        public final void writeBindedPresentation(java.lang.String file)

        Writes binded presentation to file.

        Specified by:
        writeBindedPresentation in interface IPresentationInfo
        Parameters:
        file - Presentation file.