com.aspose.slides
Class Presentation

java.lang.Object
  extended by com.aspose.slides.Presentation
All Implemented Interfaces:
com.aspose.ms.System.IDisposable, IPresentation

public final class Presentation
extends java.lang.Object
implements IPresentation

Represents a Microsoft PowerPoint presentation.


Constructor Summary
Presentation()
           This constructor creates new presentation from scratch.
Presentation(java.io.InputStream stream)
           
Presentation(java.io.InputStream stream, LoadOptions loadOptions)
           
Presentation(LoadOptions loadOptions)
           This constructor creates new presentation from scratch.
Presentation(java.lang.String file)
           This constructor gets a source file path from which the contents of the Presentation are read.
Presentation(java.lang.String file, LoadOptions loadOptions)
           This constructor gets a source file path from which the contents of the Presentation are read.
 
Method Summary
 void dispose()
           Releases all resources used by this Aspose.Slides.Pptx.PrentationEx object.
 void encrypt(java.lang.String password)
          Deprecated. 
 IAudioCollection getAudios()
           Returns the collection of all embedded audio files in the presentation.
 ICommentAuthorCollection getCommentAuthors()
           Returns the collection of comments autors.
 java.util.Date getCurrentDateTime()
           
 ICustomData getCustomData()
           Returns the presentation's custom data.
 ITextStyle getDefaultTextStyle()
           Returns default text style for shapes.
 IDocumentProperties getDocumentProperties()
           Returns DocumentProperties object which contains standard and custom document properties.
 boolean getEncryptDocumentProperties()
          Deprecated. 
 IHeaderFooterManager getHeaderFooterManager()
           Returns actual HeaderFooter manager.
 IHyperlinkQueries getHyperlinkQueries()
           Provides easy access to all hyperlinks contained in all presentation slides (not in master, layout, notes slides).
 IImageCollection getImages()
           Returns the collection of all images in the presentation.
 IGlobalLayoutSlideCollection getLayoutSlides()
           Returns a list of all layout slides that are defined in the presentation.
 IMasterHandoutSlideManager getMasterHandoutSlideManager()
           
 IMasterNotesSlideManager getMasterNotesSlideManager()
           
 IMasterSlideCollection getMasters()
           Returns a list of all master slides that are defined in the presentation.
 IMasterTheme getMasterTheme()
           
 IProtectionManager getProtectionManager()
           Gets manager of the permissions for this presentation.
 ISlideCollection getSlides()
           Returns a list of all slides that are defined in the presentation.
 ISlideSize getSlideSize()
           Returns slide size object.
 int getSourceFormat()
           Returns information about from which format presentation was loaded.
 ITagCollection getTags()
          Deprecated. 
 boolean getUpdateDateTimeFields()
           Determines wheather Aspose.Slides should update date and time fields.
 boolean getUpdateSlideNumberFields()
           Determines wheather Aspose.Slides should update slide number fields.
 byte[] getVbaProject()
           Gets VBA project with presentation macros in binary format (as OLE container).
 IVideoCollection getVideos()
           Returns the collection of all embedded video files in the presentation.
 boolean isEncrypted()
          Deprecated. 
 boolean isOnlyDocumentPropertiesLoaded()
          Deprecated. 
 boolean isWriteProtected()
          Deprecated. 
 void removeEncryption()
          Deprecated. 
 void removeWriteProtection()
          Deprecated. 
 void save(java.io.OutputStream stream, int format)
           
 void save(java.io.OutputStream stream, int format, ISaveOptions options)
           
 void save(java.lang.String fname, int format)
           Saves all slides of a presentation to a file with the specified format.
 void save(java.lang.String fname, int format, ISaveOptions options)
           Saves all slides of a presentation to a file with the specified format and with additional options.
 void setCurrentDateTime(java.util.Date value)
           
 void setEncryptDocumentProperties(boolean value)
          Deprecated. 
 void setUpdateDateTimeFields(boolean value)
           
 void setUpdateSlideNumberFields(boolean value)
           
 void setVbaProject(byte[] value)
           
 void setWriteProtection(java.lang.String password)
          Deprecated. 
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Presentation

public Presentation()

This constructor creates new presentation from scratch. Created presentation has one empty slide.


Presentation

public Presentation(LoadOptions loadOptions)

This constructor creates new presentation from scratch. Created presentation has one empty slide.

Parameters:
loadOptions - Additional load options.

Presentation

public Presentation(java.io.InputStream stream)

Presentation

public Presentation(java.io.InputStream stream,
                    LoadOptions loadOptions)

Presentation

public Presentation(java.lang.String file)

This constructor gets a source file path from which the contents of the Presentation are read.


  
  [C#]
  Presentation pres = new Presentation("demo.pptx");
  [Visual Basic]
  Dim pres As Presentation = New Presentation("demo.pptx")
  

Parameters:
file - Input file.

Presentation

public Presentation(java.lang.String file,
                    LoadOptions loadOptions)

This constructor gets a source file path from which the contents of the Presentation are read.

Parameters:
file - Input file.
loadOptions - Additional load options.
Method Detail

getCurrentDateTime

public java.util.Date getCurrentDateTime()
Specified by:
getCurrentDateTime in interface IPresentation

setCurrentDateTime

public void setCurrentDateTime(java.util.Date value)
Specified by:
setCurrentDateTime in interface IPresentation

getUpdateSlideNumberFields

public boolean getUpdateSlideNumberFields()

Determines wheather Aspose.Slides should update slide number fields. True by default. Read/write bool.

Specified by:
getUpdateSlideNumberFields in interface IPresentation

setUpdateSlideNumberFields

public void setUpdateSlideNumberFields(boolean value)
Specified by:
setUpdateSlideNumberFields in interface IPresentation

getUpdateDateTimeFields

public boolean getUpdateDateTimeFields()

Determines wheather Aspose.Slides should update date and time fields. False by default. Read/write bool.

Specified by:
getUpdateDateTimeFields in interface IPresentation

setUpdateDateTimeFields

public void setUpdateDateTimeFields(boolean value)
Specified by:
setUpdateDateTimeFields in interface IPresentation

getHeaderFooterManager

public IHeaderFooterManager getHeaderFooterManager()

Returns actual HeaderFooter manager.

Specified by:
getHeaderFooterManager in interface IPresentation

getProtectionManager

public IProtectionManager getProtectionManager()

Gets manager of the permissions for this presentation.

Specified by:
getProtectionManager in interface IPresentation

getEncryptDocumentProperties

@Deprecated
public boolean getEncryptDocumentProperties()
Deprecated. 

This property makes sense, if presentation is password protected. If true then document properties is encrypted in presentation file. If false then document properties is public while presentation is encrypted.


setEncryptDocumentProperties

@Deprecated
public void setEncryptDocumentProperties(boolean value)
Deprecated. 


isEncrypted

@Deprecated
public boolean isEncrypted()
Deprecated. 

Gets a value indicating whether this instance is encrypted.

Value: true if presentation was loaded from encrypted file or Encrypt(string) method was called ; otherwise, false.


isOnlyDocumentPropertiesLoaded

@Deprecated
public boolean isOnlyDocumentPropertiesLoaded()
Deprecated. 

This property makes sense, if presentation file is password protected and document properties of this file are public. Value of true means that only document properties are loaded from an encrypted presentation file without use of password. Value of false means that entire encrypted presentation is loaded with use of right password, not only document properties are loaded. If presentation isn't encrypted then property value is always false. If document properties of an encrypted file aren't public then property value is always false. If Presentation.EncryptDocumentProperties is true than IsOnlyDocumentPropertiesLoaded property value is always false.


isWriteProtected

@Deprecated
public boolean isWriteProtected()
Deprecated. 

Gets a value indicating whether this presentation is write protected.


encrypt

@Deprecated
public void encrypt(java.lang.String password)
Deprecated. 

Encrypts Presentation with specified password.

Parameters:
password - The password.

removeEncryption

@Deprecated
public void removeEncryption()
Deprecated. 

Removes the encryption.


setWriteProtection

@Deprecated
public void setWriteProtection(java.lang.String password)
Deprecated. 

Set write protection for this presentation with specified password.

Parameters:
password - The password.

removeWriteProtection

@Deprecated
public void removeWriteProtection()
Deprecated. 

Removes write protection for this presentation.


getSlides

public ISlideCollection getSlides()

Returns a list of all slides that are defined in the presentation. Read-only SlideCollection.

Specified by:
getSlides in interface IPresentation

getSlideSize

public ISlideSize getSlideSize()

Returns slide size object. Readonly SlideSize.

Specified by:
getSlideSize in interface IPresentation

getLayoutSlides

public IGlobalLayoutSlideCollection getLayoutSlides()

Returns a list of all layout slides that are defined in the presentation. Read-only IGlobalLayoutSlideCollection.


You can access to alternative API for adding/inserting/removing/cloning layout slides by using IMasterSlide.LayoutSlides property.

Specified by:
getLayoutSlides in interface IPresentation

getMasters

public IMasterSlideCollection getMasters()

Returns a list of all master slides that are defined in the presentation. Read-only MasterSlideCollection.

Specified by:
getMasters in interface IPresentation

getMasterNotesSlideManager

public IMasterNotesSlideManager getMasterNotesSlideManager()
Specified by:
getMasterNotesSlideManager in interface IPresentation

getMasterHandoutSlideManager

public IMasterHandoutSlideManager getMasterHandoutSlideManager()
Specified by:
getMasterHandoutSlideManager in interface IPresentation

getDefaultTextStyle

public ITextStyle getDefaultTextStyle()

Returns default text style for shapes. Readonly TextStyle.

Specified by:
getDefaultTextStyle in interface IPresentation

getCommentAuthors

public ICommentAuthorCollection getCommentAuthors()

Returns the collection of comments autors. Readonly CommentAuthorCollection.

Specified by:
getCommentAuthors in interface IPresentation

getDocumentProperties

public IDocumentProperties getDocumentProperties()

Returns DocumentProperties object which contains standard and custom document properties. Read-only DocumentProperties.

Specified by:
getDocumentProperties in interface IPresentation

getImages

public IImageCollection getImages()

Returns the collection of all images in the presentation. Read-only ImageCollection

Specified by:
getImages in interface IPresentation

getAudios

public IAudioCollection getAudios()

Returns the collection of all embedded audio files in the presentation. Read-only AudioCollection

Specified by:
getAudios in interface IPresentation

getVideos

public IVideoCollection getVideos()

Returns the collection of all embedded video files in the presentation. Read-only VideoCollection

Specified by:
getVideos in interface IPresentation

getTags

@Deprecated
public ITagCollection getTags()
Deprecated. 

Returns the presentation's tags collection. Read-only TagCollection.


getCustomData

public ICustomData getCustomData()

Returns the presentation's custom data. Read-only ICustomData.

Specified by:
getCustomData in interface IPresentation

getVbaProject

public byte[] getVbaProject()

Gets VBA project with presentation macros in binary format (as OLE container).

Specified by:
getVbaProject in interface IPresentation

setVbaProject

public void setVbaProject(byte[] value)
Specified by:
setVbaProject in interface IPresentation

getHyperlinkQueries

public IHyperlinkQueries getHyperlinkQueries()

Provides easy access to all hyperlinks contained in all presentation slides (not in master, layout, notes slides).

Specified by:
getHyperlinkQueries in interface IPresentation

getSourceFormat

public int getSourceFormat()

Returns information about from which format presentation was loaded.

Specified by:
getSourceFormat in interface IPresentation

getMasterTheme

public IMasterTheme getMasterTheme()
Specified by:
getMasterTheme in interface IPresentation

save

public void save(java.lang.String fname,
                 int format)

Saves all slides of a presentation to a file with the specified format.

Specified by:
save in interface IPresentation
Parameters:
fname - Path to the created file.
format - Format of the exported data.

save

public void save(java.io.OutputStream stream,
                 int format)
Specified by:
save in interface IPresentation

save

public void save(java.lang.String fname,
                 int format,
                 ISaveOptions options)

Saves all slides of a presentation to a file with the specified format and with additional options.

Specified by:
save in interface IPresentation
Parameters:
fname - Path to the created file.
format - Format of the exported data.
options - Additional format options.

save

public void save(java.io.OutputStream stream,
                 int format,
                 ISaveOptions options)
Specified by:
save in interface IPresentation

dispose

public void dispose()

Releases all resources used by this Aspose.Slides.Pptx.PrentationEx object.

Specified by:
dispose in interface com.aspose.ms.System.IDisposable