com.aspose.slides
Class Presentation

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

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)
           This constructor is the primary mechanism for reading an existing Presentation.
Presentation(java.io.InputStream stream, LoadOptions loadOptions)
           This constructor is the primary mechanism for reading an existing Presentation.
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()
           Returns or sets date and time which will substitute content of datetime fields, if UpdateDateTimeFields is true.
 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. 
 int getFirstSlideNumber()
           Represents the first slide number in the presentation
 IFontsManager getFontsManager()
           Returns fonts manager.
 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()
           Returns handout master manager.
 IMasterNotesSlideManager getMasterNotesSlideManager()
           Returns notes master manager.
 IMasterSlideCollection getMasters()
           Returns a list of all master slides that are defined in the presentation.
 IMasterTheme getMasterTheme()
           Returns master theme.
 INotesSize getNotesSize()
           Returns notes slide size object.
 com.aspose.slides.IDOMObject getParent_Immediate()
           Returns Parent_Immediate object.
 IPresentation getPresentation()
           Returns the parent presentation of a text.
static PresentationText getPresentationText(java.io.InputStream stream, int mode)
           Retreieves the raw text from the slides
static PresentationText getPresentationText(java.io.InputStream stream, int mode, LoadOptions options)
           Retreieves the raw text from the slides
static PresentationText getPresentationText(java.lang.String file, int mode)
           Retreieves the raw text from the slides
 IProtectionManager getProtectionManager()
           Gets manager of the permissions for this presentation.
 IBaseSlide getSlideById(long id)
           Returns a Slide, MasterSlide or LayoutSlide by Id.
 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. 
 IVbaProject getVbaProject()
           Gets or sets VBA project with presentation macros.
 IVideoCollection getVideos()
           Returns the collection of all embedded video files in the presentation.
 IViewProperties getViewProperties()
           Gets presentation wide view properties.
 boolean isEncrypted()
          Deprecated. 
 boolean isOnlyDocumentPropertiesLoaded()
          Deprecated. 
 boolean isWriteProtected()
          Deprecated. 
 void joinPortionsWithSameFormatting()
           Joins runs with same formatting in all paragraphs in all acceptable shapes in all slides.
 void removeEncryption()
          Deprecated. 
 void removeWriteProtection()
          Deprecated. 
 void save(java.io.OutputStream stream, int format)
           Saves all slides of a presentation to a stream in the specified format.
 void save(java.io.OutputStream stream, int[] slides, int format)
           Saves specified slides of a presentation to a stream in the specified format with page number keeping.
 void save(java.io.OutputStream stream, int[] slides, int format, ISaveOptions options)
           Saves specified slides of a presentation to a stream in the specified format with page number keeping.
 void save(java.io.OutputStream stream, int format, ISaveOptions options)
           Saves all slides of a presentation to a stream in the specified format and with additional 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[] slides, int format)
           Saves specified slides of a presentation to a file with the specified format with page number keeping.
 void save(java.lang.String fname, int[] slides, int format, ISaveOptions options)
           Saves specified slides of a presentation to a file with the specified format with page number keeping.
 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)
           Returns or sets date and time which will substitute content of datetime fields, if UpdateDateTimeFields is true.
 void setEncryptDocumentProperties(boolean value)
          Deprecated. 
 void setFirstSlideNumber(int value)
           Represents the first slide number in the presentation
 void setVbaProject(IVbaProject value)
           Gets or sets VBA project with presentation macros.
 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)

This constructor is the primary mechanism for reading an existing Presentation.


  

Parameters:
stream - Input stream.

Presentation

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

This constructor is the primary mechanism for reading an existing Presentation.

Parameters:
stream - Input stream.
loadOptions - Additional load options.

Presentation

public Presentation(java.lang.String file)

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


  

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()

Returns or sets date and time which will substitute content of datetime fields, if UpdateDateTimeFields is true. Time of this Presentation object creation by default. Read/write java.util.Date.

Specified by:
getCurrentDateTime in interface IPresentation

setCurrentDateTime

public void setCurrentDateTime(java.util.Date value)

Returns or sets date and time which will substitute content of datetime fields, if UpdateDateTimeFields is true. Time of this Presentation object creation by default. Read/write java.util.Date.

Specified by:
setCurrentDateTime in interface IPresentation

getParent_Immediate

public com.aspose.slides.IDOMObject getParent_Immediate()

Returns Parent_Immediate object. Read-only IDOMObject.


getHeaderFooterManager

public IHeaderFooterManager getHeaderFooterManager()

Returns actual HeaderFooter manager. Read-only IHeaderFooterManager.

Specified by:
getHeaderFooterManager in interface IPresentation

getPresentationText

public static PresentationText getPresentationText(java.lang.String file,
                                                   int mode)

Retreieves the raw text from the slides

Parameters:
file - Input file
mode - Extraction mode
Returns:
The instance of PresentationText containing the SlideText array representing the raw slides text

getPresentationText

public static PresentationText getPresentationText(java.io.InputStream stream,
                                                   int mode)

Retreieves the raw text from the slides

Parameters:
stream - Input stream
mode - Extraction mode
Returns:
The instance of PresentationText containing the SlideText array representing the raw slides text

getPresentationText

public static PresentationText getPresentationText(java.io.InputStream stream,
                                                   int mode,
                                                   LoadOptions options)

Retreieves the raw text from the slides

Parameters:
stream - Input stream
mode - Extraction mode
options - Load options
Returns:
The instance of PresentationText containing the SlideText array representing the raw slides text

getProtectionManager

public IProtectionManager getProtectionManager()

Gets manager of the permissions for this presentation. Read-only IProtectionManager.

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. Read/write boolean.


setEncryptDocumentProperties

@Deprecated
public void setEncryptDocumentProperties(boolean value)
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. Read/write boolean.


isEncrypted

@Deprecated
public boolean isEncrypted()
Deprecated. 

Gets a value indicating whether this instance is encrypted. Read-only boolean.

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. Read-only boolean.


isWriteProtected

@Deprecated
public boolean isWriteProtected()
Deprecated. 

Gets a value indicating whether this presentation is write protected. Read-only boolean.


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 ISlideCollection.

Specified by:
getSlides in interface IPresentation

getSlideSize

public ISlideSize getSlideSize()

Returns slide size object. Read-only ISlideSize.

Specified by:
getSlideSize in interface IPresentation

getNotesSize

public final INotesSize getNotesSize()

Returns notes slide size object. Read-only INotesSize.

Specified by:
getNotesSize 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 IMasterSlideCollection.

Specified by:
getMasters in interface IPresentation

getMasterNotesSlideManager

public IMasterNotesSlideManager getMasterNotesSlideManager()

Returns notes master manager. Read-only IMasterNotesSlideManager.

Specified by:
getMasterNotesSlideManager in interface IPresentation

getMasterHandoutSlideManager

public IMasterHandoutSlideManager getMasterHandoutSlideManager()

Returns handout master manager. Read-only IMasterHandoutSlideManager.

Specified by:
getMasterHandoutSlideManager in interface IPresentation

getFontsManager

public IFontsManager getFontsManager()

Returns fonts manager. Read-only IFontsManager.

Specified by:
getFontsManager in interface IPresentation

getDefaultTextStyle

public ITextStyle getDefaultTextStyle()

Returns default text style for shapes. Read-only ITextStyle.

Specified by:
getDefaultTextStyle in interface IPresentation

getCommentAuthors

public ICommentAuthorCollection getCommentAuthors()

Returns the collection of comments autors. Read-only ICommentAuthorCollection.

Specified by:
getCommentAuthors in interface IPresentation

getDocumentProperties

public IDocumentProperties getDocumentProperties()

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

Specified by:
getDocumentProperties in interface IPresentation

getImages

public IImageCollection getImages()

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

Specified by:
getImages in interface IPresentation

getAudios

public IAudioCollection getAudios()

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

Specified by:
getAudios in interface IPresentation

getVideos

public IVideoCollection getVideos()

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

Specified by:
getVideos in interface IPresentation

getTags

@Deprecated
public ITagCollection getTags()
Deprecated. 

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


getCustomData

public ICustomData getCustomData()

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

Specified by:
getCustomData in interface IPresentation

getVbaProject

public IVbaProject getVbaProject()

Gets or sets VBA project with presentation macros. Read/write IVbaProject.

Specified by:
getVbaProject in interface IPresentation

setVbaProject

public void setVbaProject(IVbaProject value)

Gets or sets VBA project with presentation macros. Read/write IVbaProject.

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). Read-only IHyperlinkQueries.

Specified by:
getHyperlinkQueries in interface IPresentation

getViewProperties

public IViewProperties getViewProperties()

Gets presentation wide view properties. Read-only IViewProperties.

Specified by:
getViewProperties in interface IPresentation

getFirstSlideNumber

public final int getFirstSlideNumber()

Represents the first slide number in the presentation

Specified by:
getFirstSlideNumber in interface IPresentation

setFirstSlideNumber

public final void setFirstSlideNumber(int value)

Represents the first slide number in the presentation

Specified by:
setFirstSlideNumber in interface IPresentation

getSlideById

public final IBaseSlide getSlideById(long id)

Returns a Slide, MasterSlide or LayoutSlide by Id.

Specified by:
getSlideById in interface IPresentation
Parameters:
id - Id of a slide.
Returns:
IBaseSlide object.

getSourceFormat

public int getSourceFormat()

Returns information about from which format presentation was loaded. Read-only SourceFormat.

Specified by:
getSourceFormat in interface IPresentation

getMasterTheme

public IMasterTheme getMasterTheme()

Returns master theme. Read-only IMasterTheme.

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)

Saves all slides of a presentation to a stream in the specified format.

Specified by:
save in interface IPresentation
Parameters:
stream - Output stream.
format - Format of the exported data.

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)

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

Specified by:
save in interface IPresentation
Parameters:
stream - Output stream.
format - Format of the exported data.
options - Additional format options.
Throws:
com.aspose.ms.System.NotSupportedException - If you try to save encrypted file in none Office 2007-2010 format

save

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

Saves specified slides of a presentation to a file with the specified format with page number keeping.

Specified by:
save in interface IPresentation
Parameters:
fname - Path to the created file.
slides - Array with slide positions, starting from 1.
format - Format of the exported data.
Throws:
com.aspose.ms.System.ArgumentNullException - When stream or slides parameter is null.
com.aspose.ms.System.ArgumentOutOfRangeException - When slides parameter contains wrong page numbers.
com.aspose.ms.System.InvalidOperationException - When an unsupported SaveFormat is used, e.g. PPTX, PPTM, PPSX, PPSM, POTX, POTM, PPT, ODP.

save

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

Saves specified slides of a presentation to a file with the specified format with page number keeping.

Specified by:
save in interface IPresentation
Parameters:
fname - Path to the created file.
slides - Array with slide positions, starting from 1.
format - Format of the exported data.
options - Additional format options.

save

public void save(java.io.OutputStream stream,
                 int[] slides,
                 int format)

Saves specified slides of a presentation to a stream in the specified format with page number keeping.

Specified by:
save in interface IPresentation
Parameters:
stream - Output stream.
slides - Array with slide positions, starting from 1.
format - Format of the exported data.

save

public void save(java.io.OutputStream stream,
                 int[] slides,
                 int format,
                 ISaveOptions options)

Saves specified slides of a presentation to a stream in the specified format with page number keeping.

Specified by:
save in interface IPresentation
Parameters:
stream - Output stream.
slides - Array with slide positions, starting from 1.
format - Format of the exported data.
options - Additional format options.
Throws:
com.aspose.ms.System.ArgumentNullException - When stream or slides parameter is null.
com.aspose.ms.System.ArgumentOutOfRangeException - When slides parameter contains wrong page numbers.
com.aspose.ms.System.InvalidOperationException - When an unsupported SaveFormat is used, e.g. PPTX, PPTM, PPSX, PPSM, POTX, POTM, PPT, ODP.

joinPortionsWithSameFormatting

public void joinPortionsWithSameFormatting()

Joins runs with same formatting in all paragraphs in all acceptable shapes in all slides.

Specified by:
joinPortionsWithSameFormatting in interface IPresentation

dispose

public final void dispose()

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

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

getPresentation

public IPresentation getPresentation()

Returns the parent presentation of a text. Read-only IPresentation.

Specified by:
getPresentation in interface IPresentationComponent


Copyright © Copyright 2004-2016 Aspose Pty Ltd. All Rights Reserved.