PresentationFactory

Inheritance: java.lang.Object

All Implemented Interfaces: com.aspose.slides.IPresentationFactory

public class PresentationFactory implements IPresentationFactory

Allows to create presentation via COM interface


The following example shows how to checking a Presentation Format.
 
 IPresentationInfo info = PresentationFactory.getInstance().getPresentationInfo("pres.pptx");
 System.out.println(info.getLoadFormat()); // PPTX
 IPresentationInfo info2 = PresentationFactory.getInstance().getPresentationInfo("pres.ppt");
 System.out.println(info2.getLoadFormat()); // PPT
 IPresentationInfo info3 = PresentationFactory.getInstance().getPresentationInfo("pres.odp");
 System.out.println(info3.getLoadFormat()); // ODP
 
 The following example shows how to getting the properties of a Presentation.
 
 IPresentationInfo info = PresentationFactory.getInstance().getPresentationInfo("pres.pptx");
 IDocumentProperties props = info.readDocumentProperties();
 System.out.println(props.getCreatedTime());
 System.out.println(props.getSubject());
 System.out.println(props.getTitle());
 // ..
 
 The following example shows how to updating the properties of a Presentation.
 
 IPresentationInfo info = PresentationFactory.getInstance().getPresentationInfo("pres.pptx");
 IDocumentProperties props = info.readDocumentProperties();
 props.setTitle("My title");
 info.updateDocumentProperties(props);

Constructors

ConstructorDescription
PresentationFactory()

Methods

MethodDescription
getInstance()Presentation factory static instance.
createPresentation()Creates new presentation.
createPresentation(ILoadOptions options)Creates new presentation with additional load options
getPresentationInfo(String file)Creates new PresentationInfo object from file and binds presentation to it.
getPresentationInfo(InputStream stream)Creates new PresentationInfo object from stream and binds presentation to it.
readPresentation(byte[] data)Reads an existing presentation from array
readPresentation(byte[] data, ILoadOptions options)Reads an existing presentation from array with additional load options
readPresentation(InputStream stream)Reads an existing presentation from stream
readPresentation(InputStream stream, ILoadOptions options)Reads an existing presentation from stream with additional load options
readPresentation(String file)Reads an existing presentation from file
readPresentation(String file, ILoadOptions options)Reads an existing presentation from stream with additional load options
getPresentationText(String file, int mode)Retrieves the raw text from the slides
getPresentationText(InputStream stream, int mode)Retrieves the raw text from the slides
getPresentationText(InputStream stream, int mode, ILoadOptions options)Retrieves the raw text from the slides

PresentationFactory()

public PresentationFactory()

getInstance()

public static PresentationFactory getInstance()

Presentation factory static instance. Read-only PresentationFactory.

Returns: PresentationFactory

createPresentation()

public final IPresentation createPresentation()

Creates new presentation.

Returns: IPresentation - New presentation

createPresentation(ILoadOptions options)

public final IPresentation createPresentation(ILoadOptions options)

Creates new presentation with additional load options

Parameters:

ParameterTypeDescription
optionsILoadOptionsLoad options

Returns: IPresentation - New presentation

getPresentationInfo(String file)

public final IPresentationInfo getPresentationInfo(String file)

Creates new PresentationInfo object from file and binds presentation to it.

Parameters:

ParameterTypeDescription
filejava.lang.StringPresentation file.

Returns: IPresentationInfo - Presentation info binded to presentation.

getPresentationInfo(InputStream stream)

public final IPresentationInfo getPresentationInfo(InputStream stream)

Creates new PresentationInfo object from stream and binds presentation to it. Gets info about presentation in specified stream.

Parameters:

ParameterTypeDescription
streamjava.io.InputStreamPresentation stream.

Returns: IPresentationInfo - Presentation info binded to presentation.

readPresentation(byte[] data)

public final IPresentation readPresentation(byte[] data)

Reads an existing presentation from array

Parameters:

ParameterTypeDescription
databyte[]Array to read

Returns: IPresentation - Read presentation

readPresentation(byte[] data, ILoadOptions options)

public final IPresentation readPresentation(byte[] data, ILoadOptions options)

Reads an existing presentation from array with additional load options

Parameters:

ParameterTypeDescription
databyte[]Array to read
optionsILoadOptionsLoad options

Returns: IPresentation - Read presentation

readPresentation(InputStream stream)

public final IPresentation readPresentation(InputStream stream)

Reads an existing presentation from stream

Parameters:

ParameterTypeDescription
streamjava.io.InputStreamInput stream to read

Returns: IPresentation - Read presentation

readPresentation(InputStream stream, ILoadOptions options)

public final IPresentation readPresentation(InputStream stream, ILoadOptions options)

Reads an existing presentation from stream with additional load options

Parameters:

ParameterTypeDescription
streamjava.io.InputStreamInput stream to read
optionsILoadOptionsLoad options

Returns: IPresentation - Read presentation

readPresentation(String file)

public final IPresentation readPresentation(String file)

Reads an existing presentation from file

Parameters:

ParameterTypeDescription
filejava.lang.StringFile name

Returns: IPresentation - Read presentation

readPresentation(String file, ILoadOptions options)

public final IPresentation readPresentation(String file, ILoadOptions options)

Reads an existing presentation from stream with additional load options

Parameters:

ParameterTypeDescription
filejava.lang.StringFile name
optionsILoadOptionsLoad options

Returns: IPresentation - Read presentation

getPresentationText(String file, int mode)

public final IPresentationText getPresentationText(String file, int mode)

Retrieves the raw text from the slides

Parameters:

ParameterTypeDescription
filejava.lang.StringInput file
modeintExtraction mode

Returns: IPresentationText - The instance of PresentationText containing the SlideText array representing the raw slides text

getPresentationText(InputStream stream, int mode)

public final IPresentationText getPresentationText(InputStream stream, int mode)

Retrieves the raw text from the slides

Parameters:

ParameterTypeDescription
streamjava.io.InputStreamInput stream
modeintExtraction mode

Returns: IPresentationText - The instance of PresentationText containing the SlideText array representing the raw slides text

getPresentationText(InputStream stream, int mode, ILoadOptions options)

public final IPresentationText getPresentationText(InputStream stream, int mode, ILoadOptions options)

Retrieves the raw text from the slides

Parameters:

ParameterTypeDescription
streamjava.io.InputStreamInput stream
modeintExtraction mode
optionsILoadOptionsLoad options

Returns: IPresentationText - The instance of PresentationText containing the SlideText array representing the raw slides text