com.aspose.slides

Interfaces

Classes

Exceptions

com.aspose.slides

Class Presentation

  • java.lang.Object
    • com.aspose.slides.Presentation
    • 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.


         
         
         FileInputStream fis = new FileInputStream("demo.pptx");
         Presentation pres = new Presentation(fis);
         fis.close();
         

        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.


         
         
         Presentation pres = new Presentation("demo.pptx");
         

        Parameters:
        file - Input file.
        Throws:
        com.aspose.ms.System.ArgumentException - Thrown when input file has zero length
      • 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.
        Throws:
        com.aspose.ms.System.ArgumentException - Thrown when input file has zero length
    • Method Detail

      • getCurrentDateTime

        public final java.util.Date getCurrentDateTime()

        Returns or sets date and time which will substitute content of datetime fields. Time of this Presentation object creation by default. Read/write Date.

        Specified by:
        getCurrentDateTime in interface IPresentation
      • setCurrentDateTime

        public final void setCurrentDateTime(java.util.Date value)

        Returns or sets date and time which will substitute content of datetime fields. Time of this Presentation object creation by default. Read/write Date.

        Specified by:
        setCurrentDateTime in interface IPresentation
      • getParent_Immediate

        public final com.aspose.slides.IDOMObject getParent_Immediate()

        Returns Parent_Immediate object. Read-only IDOMObject.

      • 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 final int getSourceFormat()

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

        Specified by:
        getSourceFormat in interface IPresentation
      • save

        public final 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 final 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 final 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 final 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
      • getThumbnails

        public final java.awt.image.BufferedImage[] getThumbnails(INotesCommentsLayoutingOptions notesCommentsLayouting)

        Returns a Thumbnail BufferedImage objects for all slides of a presentation.

        Specified by:
        getThumbnails in interface IPresentation
        Parameters:
        notesCommentsLayouting - Options for notes and comments layouting.
        Returns:
        BufferedImage objects.
      • getThumbnails

        public final java.awt.image.BufferedImage[] getThumbnails(INotesCommentsLayoutingOptions notesCommentsLayouting,
                                                                  int[] slides)

        Returns a Thumbnail BufferedImage objects for specified slides of a presentation.

        Specified by:
        getThumbnails in interface IPresentation
        Parameters:
        notesCommentsLayouting - Options for notes and comments layouting.
        slides - Array with slide positions, starting from 1.
        Returns:
        BufferedImage objects.
      • getThumbnails

        public final java.awt.image.BufferedImage[] getThumbnails(INotesCommentsLayoutingOptions notesCommentsLayouting,
                                                                  float scaleX,
                                                                  float scaleY)

        Returns a Thumbnail BufferedImage objects for all slides of a presentation with custom scaling.

        Specified by:
        getThumbnails in interface IPresentation
        Parameters:
        notesCommentsLayouting - Options for notes and comments layouting.
        scaleX - The value by which to scale this Thumbnail in the x-axis direction.
        scaleY - The value by which to scale this Thumbnail in the y-axis direction.
        Returns:
        BufferedImage objects.
      • getThumbnails

        public final java.awt.image.BufferedImage[] getThumbnails(INotesCommentsLayoutingOptions notesCommentsLayouting,
                                                                  int[] slides,
                                                                  float scaleX,
                                                                  float scaleY)

        Returns a Thumbnail BufferedImage objects for specified slides of a presentation with custom scaling.

        Specified by:
        getThumbnails in interface IPresentation
        Parameters:
        notesCommentsLayouting - Options for notes and comments layouting.
        slides - Array with slide positions, starting from 1.
        scaleX - The value by which to scale this Thumbnail in the x-axis direction.
        scaleY - The value by which to scale this Thumbnail in the y-axis direction.
        Returns:
        BufferedImage objects.
      • getThumbnails

        public final java.awt.image.BufferedImage[] getThumbnails(INotesCommentsLayoutingOptions notesCommentsLayouting,
                                                                  java.awt.Dimension imageSize)

        Returns a Thumbnail BufferedImage objects for all slides of a presentation with specified size.

        Specified by:
        getThumbnails in interface IPresentation
        Parameters:
        notesCommentsLayouting - Options for notes and comments layouting.
        imageSize - Size of the image to create.
        Returns:
        BufferedImage objects.
      • getThumbnails

        public final java.awt.image.BufferedImage[] getThumbnails(INotesCommentsLayoutingOptions notesCommentsLayouting,
                                                                  int[] slides,
                                                                  java.awt.Dimension imageSize)

        Returns a Thumbnail BufferedImage objects for specified slides of a presentation with specified size.

        Specified by:
        getThumbnails in interface IPresentation
        Parameters:
        notesCommentsLayouting - Options for notes and comments layouting.
        slides - Array with slide positions, starting from 1.
        imageSize - Size of the image to create.
        Returns:
        BufferedImage objects.
      • save

        public final 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 final 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 final 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 final 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 final 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