def get_properties(dataDir):

        dataDir = Settings.dataDir + 'WorkingWithPresentation/Properties/'

        # Instantiate the Presentation class that represents the presentation
        pres = Presentation(dataDir + "HelloWorld.pptx")

        # Create a reference to IDocumentProperties object associated with Presentation
        dp = pres.getDocumentProperties()

        # Display the builtin properties
        print "Category : " + dp.getCategory()
        print "Current Status : " + dp.getContentStatus()
        print "Creation Date : "
        dp.getCreatedTime()
        print "Author : " + dp.getAuthor()
        print "Description : " + dp.getComments()
        print "KeyWords : " + dp.getKeywords()
        print "Last Modified By : " + dp.getLastSavedBy()
        print "Supervisor : " + dp.getManager()
        print "Modified Date : "
        dp.getLastSavedTime()
        print "Presentation Format : "
        dp.getPresentationFormat()
        print "Last Print Date : "
        dp.getLastPrinted()
        print "Is Shared between producers : "
        dp.getSharedDoc()
        print "Subject : "
        dp.getSubject()
        print "Title : "
        dp.getTitle()
Пример #2
0
    def get_properties(dataDir):
    
        dataDir = Settings.dataDir + 'WorkingWithPresentation/Properties/'
        
         # Instantiate the Presentation class that represents the presentation
        pres = Presentation(dataDir + "HelloWorld.pptx")

        # Create a reference to IDocumentProperties object associated with Presentation
        dp = pres.getDocumentProperties()

        # Display the builtin properties
        print "Category : " + dp.getCategory()
        print "Current Status : " + dp.getContentStatus()
        print "Creation Date : "
        dp.getCreatedTime()
        print "Author : " + dp.getAuthor()
        print "Description : " + dp.getComments()
        print "KeyWords : " + dp.getKeywords()
        print "Last Modified By : " + dp.getLastSavedBy()
        print "Supervisor : " + dp.getManager()
        print "Modified Date : " 
        dp.getLastSavedTime()
        print "Presentation Format : "
        dp.getPresentationFormat()
        print "Last Print Date : " 
        dp.getLastPrinted()
        print "Is Shared between producers : "
        dp.getSharedDoc()
        print "Subject : "
        dp.getSubject()
        print "Title : "
        dp.getTitle()
    def add_custom_properties(dataDir):

        dataDir = Settings.dataDir + 'WorkingWithPresentation/Properties/'

        #Instantiate the Presentation class that represents the presentation
        pres = Presentation(dataDir + "HelloWorld.pptx")

        # Getting Document Properties
        dp = pres.getDocumentProperties()

        # Adding Custom properties
        dp.set_Item("New Custom", 12)
        dp.set_Item("My Name", "Mudassir")
        dp.set_Item("Custom", 124)

        # Saving presentation
        save_format = SaveFormat
        pres.save(dataDir + "CustomDemo.pptx", save_format.Pptx)

        print "Added custom properties, please check output file."
Пример #4
0
    def add_custom_properties(dataDir):
        
        dataDir = Settings.dataDir + 'WorkingWithPresentation/Properties/'
        
        #Instantiate the Presentation class that represents the presentation
        pres = Presentation(dataDir + "HelloWorld.pptx")

        # Getting Document Properties
        dp = pres.getDocumentProperties()

        # Adding Custom properties
        dp.set_Item("New Custom" , 12)
        dp.set_Item("My Name","Mudassir")
        dp.set_Item("Custom", 124)

        # Saving presentation
        save_format = SaveFormat
        pres.save(dataDir + "CustomDemo.pptx", save_format.Pptx)

        print "Added custom properties, please check output file."
    def remove_property(dataDir):

        dataDir = Settings.dataDir + 'WorkingWithPresentation/Properties/'

        # Instantiate the Presentation class that represents the presentation
        pres = Presentation(dataDir + "HelloWorld.pptx")

        # Getting Document Properties
        dp = pres.getDocumentProperties()

        # Getting property name at particular index
        property_name = dp.getPropertyName(2)

        # Removing selected property
        dp.remove(property_name)

        # Saving presentation
        save_format = SaveFormat
        pres.save(dataDir + "RemoveDP.pptx", save_format.Pptx)

        print "Remove document property, please check output file."
Пример #6
0
    def remove_property(dataDir):
        
        dataDir = Settings.dataDir + 'WorkingWithPresentation/Properties/'
        
        # Instantiate the Presentation class that represents the presentation
        pres = Presentation(dataDir + "HelloWorld.pptx")

        # Getting Document Properties
        dp = pres.getDocumentProperties()

        # Getting property name at particular index
        property_name = dp.getPropertyName(2)

        # Removing selected property
        dp.remove(property_name)

        # Saving presentation
        save_format = SaveFormat
        pres.save(dataDir + "RemoveDP.pptx", save_format.Pptx)

        print "Remove document property, please check output file."
    def update_properties(dataDir):

        dataDir = Settings.dataDir + 'WorkingWithPresentation/Properties/'

        # Instantiate the Presentation class that represents the presentation
        pres = Presentation(dataDir + "HelloWorld.pptx")

        # Create a reference to IDocumentProperties object associated with Presentation
        dp = pres.getDocumentProperties()

        # Set the builtin properties
        dp.setAuthor("Aspose.Slides for Java")
        dp.setTitle("Modifying Presentation Properties")
        dp.setSubject("Aspose Subject")
        dp.setComments("Aspose Description")
        dp.setManager("Aspose Manager")

        # Save your presentation to a file
        save_format = SaveFormat
        pres.save(dataDir + "DocProps.pptx", save_format.Pptx)

        print "Properties have been updated, Please check output file."
Пример #8
0
    def update_properties(dataDir):
        
        dataDir = Settings.dataDir + 'WorkingWithPresentation/Properties/'
        
        # Instantiate the Presentation class that represents the presentation
        pres = Presentation(dataDir + "HelloWorld.pptx")

        # Create a reference to IDocumentProperties object associated with Presentation
        dp = pres.getDocumentProperties()

        # Set the builtin properties
        dp.setAuthor ("Aspose.Slides for Java")
        dp.setTitle ("Modifying Presentation Properties")
        dp.setSubject ( "Aspose Subject")
        dp.setComments ( "Aspose Description")
        dp.setManager ( "Aspose Manager")

        # Save your presentation to a file
        save_format = SaveFormat
        pres.save(dataDir + "DocProps.pptx", save_format.Pptx)

        print "Properties have been updated, Please check output file."