com.aspose.slides

Interfaces

Classes

Exceptions

com.aspose.slides

Interface IPresentationInfo

  • All Known Implementing Classes:
    PresentationInfo


    public interface IPresentationInfo

    Information about presentation file

    • Method Detail

      • isEncrypted

        boolean isEncrypted()

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

      • isPasswordProtected

        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 a password to open.");
         }
         
      • isWriteProtected

        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.");
         }
         


        If the presentation is protected by a password to open, the property value equals NotDefined. See NullableBool enumeration.
      • getLoadFormat

        int getLoadFormat()

        Gets format of the binded presentation. Read-only LoadFormat.

      • checkWriteProtection

        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");
         }
         
        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

        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");
         
        Parameters:
        documentProperties - Document properties IDocumentProperties
      • writeBindedPresentation

        void writeBindedPresentation(java.io.OutputStream stream)

        Writes binded presentation to stream.

        Parameters:
        stream - The stream must be seekable and writable.
      • writeBindedPresentation

        void writeBindedPresentation(java.lang.String file)

        Writes binded presentation to file.

        Parameters:
        file - Presentation file.