IPresentation
All Implemented Interfaces: com.aspose.slides.IPresentationComponent, com.aspose.ms.System.IDisposable
public interface IPresentation extends IPresentationComponent, System.IDisposable
Presentation document
Methods
Method | Description |
---|---|
getCurrentDateTime() | Returns or sets date and time which will substitute content of datetime fields. |
setCurrentDateTime(Date value) | Returns or sets date and time which will substitute content of datetime fields. |
getHeaderFooterManager() | Returns HeaderFooter manager of the presentation. |
getProtectionManager() | Gets manager of the permissions for this presentation. |
getSlides() | Returns a list of all slides that are defined in the presentation. |
getSections() | Returns a list of all slides sections that are defined in the presentation. |
getSlideSize() | Returns slide size object. |
getNotesSize() | Returns notes slide size object. |
getLayoutSlides() | Returns a list of all layout slides that are defined in the presentation. |
getMasters() | Returns a list of all master slides that are defined in the presentation. |
getMasterNotesSlideManager() | Returns notes master manager. |
getMasterHandoutSlideManager() | Returns handout master manager. |
getFontsManager() | Returns fonts manager. |
getDefaultTextStyle() | Returns default text style for shapes. |
getCommentAuthors() | Returns the collection of comments autors. |
getDocumentProperties() | Returns DocumentProperties object which contains standard and custom document properties. |
getImages() | Returns the collection of all images in the presentation. |
getAudios() | Returns the collection of all embedded audio files in the presentation. |
getVideos() | Returns the collection of all embedded video files in the presentation. |
getCustomData() | Returns the presentation’s custom data. |
getVbaProject() | Gets VBA project with presentation macros. |
setVbaProject(IVbaProject value) | Gets VBA project with presentation macros. |
getSourceFormat() | Returns information about from which format presentation was loaded. |
getMasterTheme() | Returns master theme of the presentation. |
getHyperlinkQueries() | Provides easy access to all hyperlinks contained in all presentation slides (not in master, layout, notes slides). |
getViewProperties() | Gets presentation wide view properties. |
getFirstSlideNumber() | Represents the first slide number in the presentation. |
setFirstSlideNumber(int value) | Represents the first slide number in the presentation. |
getAllCustomXmlParts() | Returns all custom data parts in the presentaion. |
getDigitalSignatures() | Returns the collection of signatures used to sign the presentation. |
save(String fname, int format) | Saves all slides of a presentation to a file with the specified format. |
save(OutputStream stream, int format) | Saves all slides of a presentation to a stream in the specified format. |
save(String fname, int format, ISaveOptions options) | Saves all slides of a presentation to a file with the specified format and with additional options. |
save(OutputStream stream, int format, ISaveOptions options) | Saves all slides of a presentation to a stream in the specified format and with additional options. |
save(String fname, int[] slides, int format) | Saves specified slides of a presentation to a file with the specified format. |
save(String fname, int[] slides, int format, ISaveOptions options) | Saves specified slides of a presentation to a file with the specified format. |
save(OutputStream stream, int[] slides, int format) | Saves specified slides of a presentation to a stream in the specified format. |
save(OutputStream stream, int[] slides, int format, ISaveOptions options) | Saves specified slides of a presentation to a stream in the specified format. |
save(IXamlOptions options) | Saves all slides of a presentation to a set of files representing XAML markup. |
getThumbnails(IRenderingOptions options) | Returns a Thumbnail BufferedImage objects for all slides of a presentation. |
getImages(IRenderingOptions options) | Returns a Thumbnail Image objects for all slides of a presentation. |
getThumbnails(IRenderingOptions options, int[] slides) | Returns a Thumbnail BufferedImage objects for specified slides of a presentation. |
getImages(IRenderingOptions options, int[] slides) | Returns a Thumbnail Image objects for specified slides of a presentation. |
getThumbnails(IRenderingOptions options, float scaleX, float scaleY) | Returns a Thumbnail BufferedImage objects for all slides of a presentation with custom scaling. |
getImages(IRenderingOptions options, float scaleX, float scaleY) | Returns a Thumbnail Image objects for all slides of a presentation with custom scaling. |
getThumbnails(IRenderingOptions options, int[] slides, float scaleX, float scaleY) | Returns a Thumbnail BufferedImage objects for specified slides of a presentation with custom scaling. |
getImages(IRenderingOptions options, int[] slides, float scaleX, float scaleY) | Returns a Thumbnail Image objects for specified slides of a presentation with custom scaling. |
getThumbnails(IRenderingOptions options, Dimension imageSize) | Returns a Thumbnail BufferedImage objects for all slides of a presentation with specified size. |
getImages(IRenderingOptions options, Dimension imageSize) | Returns a Thumbnail Image objects for all slides of a presentation with specified size. |
getThumbnails(IRenderingOptions options, int[] slides, Dimension imageSize) | Returns a Thumbnail Bitmap objects for specified slides of a presentation with specified size. |
getImages(IRenderingOptions options, int[] slides, Dimension imageSize) | Returns a Thumbnail Image objects for specified slides of a presentation with specified size. |
getSlideById(long id) | Returns a Slide, MasterSlide or LayoutSlide by Id. |
joinPortionsWithSameFormatting() | Joins runs with same formatting in all paragraphs in all acceptable shapes in all slides. |
highlightText(String text, Color highlightColor) | Highlights all matches of the sample text with the specified color. |
highlightText(String text, Color highlightColor, ITextSearchOptions options, IFindResultCallback callback) | Highlights all matches of the sample text with the specified color. |
highlightRegex(Pattern regex, Color highlightColor, IFindResultCallback callback) | Highlights all matches of the regular expression with the specified color. |
replaceText(String oldText, String newText, ITextSearchOptions options, IFindResultCallback callback) | Replaces all occurrences of the specified text with another specified text. |
replaceRegex(Pattern regex, String newText, IFindResultCallback callback) | Replaces all matches of the regular expression with the specified string. |
getCurrentDateTime()
public abstract 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 java.util.Date.
Returns: java.util.Date
setCurrentDateTime(Date value)
public abstract void setCurrentDateTime(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 java.util.Date.
Parameters:
Parameter | Type | Description |
---|---|---|
value | java.util.Date |
getHeaderFooterManager()
public abstract IPresentationHeaderFooterManager getHeaderFooterManager()
Returns HeaderFooter manager of the presentation. Read-only IPresentationHeaderFooterManager.
Returns: IPresentationHeaderFooterManager
getProtectionManager()
public abstract IProtectionManager getProtectionManager()
Gets manager of the permissions for this presentation. Read-only IProtectionManager.
Returns: IProtectionManager
getSlides()
public abstract ISlideCollection getSlides()
Returns a list of all slides that are defined in the presentation. Read-only ISlideCollection.
Returns: ISlideCollection
getSections()
public abstract ISectionCollection getSections()
Returns a list of all slides sections that are defined in the presentation. Read-only ISectionCollection.
Returns: ISectionCollection
getSlideSize()
public abstract ISlideSize getSlideSize()
Returns slide size object. Read-only ISlideSize.
Returns: ISlideSize
getNotesSize()
public abstract INotesSize getNotesSize()
Returns notes slide size object. Read-only INotesSize.
Returns: INotesSize
getLayoutSlides()
public abstract 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.
Returns: IGlobalLayoutSlideCollection
getMasters()
public abstract IMasterSlideCollection getMasters()
Returns a list of all master slides that are defined in the presentation. Read-only IMasterSlideCollection.
Returns: IMasterSlideCollection
getMasterNotesSlideManager()
public abstract IMasterNotesSlideManager getMasterNotesSlideManager()
Returns notes master manager. Read-only IMasterNotesSlideManager.
Returns: IMasterNotesSlideManager
getMasterHandoutSlideManager()
public abstract IMasterHandoutSlideManager getMasterHandoutSlideManager()
Returns handout master manager. Read-only IMasterHandoutSlideManager.
Returns: IMasterHandoutSlideManager
getFontsManager()
public abstract IFontsManager getFontsManager()
Returns fonts manager. Read-only IFontsManager.
Returns: IFontsManager
getDefaultTextStyle()
public abstract ITextStyle getDefaultTextStyle()
Returns default text style for shapes. Read-only ITextStyle.
Returns: ITextStyle
getCommentAuthors()
public abstract ICommentAuthorCollection getCommentAuthors()
Returns the collection of comments autors. Read-only ICommentAuthorCollection.
Returns: ICommentAuthorCollection
getDocumentProperties()
public abstract IDocumentProperties getDocumentProperties()
Returns DocumentProperties object which contains standard and custom document properties. Read-only IDocumentProperties.
Returns: IDocumentProperties
getImages()
public abstract IImageCollection getImages()
Returns the collection of all images in the presentation. Read-only IImageCollection.
Returns: IImageCollection
getAudios()
public abstract IAudioCollection getAudios()
Returns the collection of all embedded audio files in the presentation. Read-only IAudioCollection.
Returns: IAudioCollection
getVideos()
public abstract IVideoCollection getVideos()
Returns the collection of all embedded video files in the presentation. Read-only IVideoCollection.
Returns: IVideoCollection
getCustomData()
public abstract ICustomData getCustomData()
Returns the presentation’s custom data. Read-only ICustomData.
Returns: ICustomData
getVbaProject()
public abstract IVbaProject getVbaProject()
Gets VBA project with presentation macros. Read/write IVbaProject.
Returns: IVbaProject
setVbaProject(IVbaProject value)
public abstract void setVbaProject(IVbaProject value)
Gets VBA project with presentation macros. Read/write IVbaProject.
Parameters:
Parameter | Type | Description |
---|---|---|
value | IVbaProject |
getSourceFormat()
public abstract int getSourceFormat()
Returns information about from which format presentation was loaded. Read-only #getSourceFormat.getSourceFormat.
Returns: int
getMasterTheme()
public abstract IMasterTheme getMasterTheme()
Returns master theme of the presentation. Read-only IMasterTheme.
Returns: IMasterTheme
getHyperlinkQueries()
public abstract IHyperlinkQueries getHyperlinkQueries()
Provides easy access to all hyperlinks contained in all presentation slides (not in master, layout, notes slides). Read-only IHyperlinkQueries.
Returns: IHyperlinkQueries
getViewProperties()
public abstract IViewProperties getViewProperties()
Gets presentation wide view properties. Read-only IViewProperties.
Returns: IViewProperties
getFirstSlideNumber()
public abstract int getFirstSlideNumber()
Represents the first slide number in the presentation. Read/write int.
Returns: int
setFirstSlideNumber(int value)
public abstract void setFirstSlideNumber(int value)
Represents the first slide number in the presentation. Read/write int.
Parameters:
Parameter | Type | Description |
---|---|---|
value | int |
getAllCustomXmlParts()
public abstract ICustomXmlPart[] getAllCustomXmlParts()
Returns all custom data parts in the presentaion. Read-only ICustomXmlPart[].
Returns: com.aspose.slides.ICustomXmlPart[]
getDigitalSignatures()
public abstract IDigitalSignatureCollection getDigitalSignatures()
Returns the collection of signatures used to sign the presentation. Read-only IDigitalSignatureCollection.
Presentation pres = new Presentation("SomePresentationSigned.pptx"); try { if (pres.getDigitalSignatures().size() > 0) { boolean allSignaturesAreValid = true; System.out.println("Signatures used to sign the presentation: "); for (IDigitalSignature signature : pres.getDigitalSignatures()) { System.out.println(signature.getCertificate().hashCode() + ", " + signature.getSignTime().toString() + " -- " + (signature.isValid() ? "VALID" : "INVALID")); allSignaturesAreValid &= signature.isValid(); } if (allSignaturesAreValid) System.out.println("Presentation is genuine, all signatures are valid."); else System.out.println("Presentation has been modified since signing."); } } finally { if (pres != null) pres.dispose(); }
Returns: IDigitalSignatureCollection
save(String fname, int format)
public abstract void save(String fname, int format)
Saves all slides of a presentation to a file with the specified format.
Parameters:
Parameter | Type | Description |
---|---|---|
fname | java.lang.String | Path to the created file. |
format | int | Format of the exported data. |
save(OutputStream stream, int format)
public abstract void save(OutputStream stream, int format)
Saves all slides of a presentation to a stream in the specified format.
Parameters:
Parameter | Type | Description |
---|---|---|
stream | java.io.OutputStream | Output stream. |
format | int | Format of the exported data. |
save(String fname, int format, ISaveOptions options)
public abstract void save(String fname, int format, ISaveOptions options)
Saves all slides of a presentation to a file with the specified format and with additional options.
Parameters:
Parameter | Type | Description |
---|---|---|
fname | java.lang.String | Path to the created file. |
format | int | Format of the exported data. |
options | ISaveOptions | Additional format options. |
save(OutputStream stream, int format, ISaveOptions options)
public abstract void save(OutputStream stream, int format, ISaveOptions options)
Saves all slides of a presentation to a stream in the specified format and with additional options.
Parameters:
Parameter | Type | Description |
---|---|---|
stream | java.io.OutputStream | Output stream. |
format | int | Format of the exported data. |
options | ISaveOptions | Additional format options. |
save(String fname, int[] slides, int format)
public abstract void save(String fname, int[] slides, int format)
Saves specified slides of a presentation to a file with the specified format.
Parameters:
Parameter | Type | Description |
---|---|---|
fname | java.lang.String | Path to the created file. |
slides | int[] | Array with slide positions, starting from 1. |
format | int | Format of the exported data. |
save(String fname, int[] slides, int format, ISaveOptions options)
public abstract void save(String fname, int[] slides, int format, ISaveOptions options)
Saves specified slides of a presentation to a file with the specified format.
Parameters:
Parameter | Type | Description |
---|---|---|
fname | java.lang.String | Path to the created file. |
slides | int[] | Array with slide positions, starting from 1. |
format | int | Format of the exported data. |
options | ISaveOptions | Additional format options. |
save(OutputStream stream, int[] slides, int format)
public abstract void save(OutputStream stream, int[] slides, int format)
Saves specified slides of a presentation to a stream in the specified format.
Parameters:
Parameter | Type | Description |
---|---|---|
stream | java.io.OutputStream | Output stream. |
slides | int[] | Array with slide positions, starting from 1. |
format | int | Format of the exported data. |
save(OutputStream stream, int[] slides, int format, ISaveOptions options)
public abstract void save(OutputStream stream, int[] slides, int format, ISaveOptions options)
Saves specified slides of a presentation to a stream in the specified format.
Parameters:
Parameter | Type | Description |
---|---|---|
stream | java.io.OutputStream | Output stream. |
slides | int[] | Array with slide positions, starting from 1. |
format | int | Format of the exported data. |
options | ISaveOptions | Additional format options. |
save(IXamlOptions options)
public abstract void save(IXamlOptions options)
Saves all slides of a presentation to a set of files representing XAML markup.
Presentation pres = new Presentation("pres.pptx"); try { XamlOptions xamlOptions = new XamlOptions(); xamlOptions.setExportHiddenSlides(true); pres.save(xamlOptions); } finally { if (pres != null) pres.dispose(); }
Parameters:
Parameter | Type | Description |
---|---|---|
options | IXamlOptions | The XAML format options. |
getThumbnails(IRenderingOptions options)
public abstract BufferedImage[] getThumbnails(IRenderingOptions options)
Returns a Thumbnail BufferedImage objects for all slides of a presentation.
Parameters:
Parameter | Type | Description |
---|---|---|
options | IRenderingOptions | Rendering options. |
Returns: java.awt.image.BufferedImage[] - BufferedImage objects.
getImages(IRenderingOptions options)
public abstract IImage[] getImages(IRenderingOptions options)
Returns a Thumbnail Image objects for all slides of a presentation.
Parameters:
Parameter | Type | Description |
---|---|---|
options | IRenderingOptions | Rendering options. |
Returns: com.aspose.slides.IImage[] - Image objects.
getThumbnails(IRenderingOptions options, int[] slides)
public abstract BufferedImage[] getThumbnails(IRenderingOptions options, int[] slides)
Returns a Thumbnail BufferedImage objects for specified slides of a presentation.
Parameters:
Parameter | Type | Description |
---|---|---|
options | IRenderingOptions | Rendering options. |
slides | int[] | Array with slide positions, starting from 1. |
Returns: java.awt.image.BufferedImage[] - BufferedImage objects.
getImages(IRenderingOptions options, int[] slides)
public abstract IImage[] getImages(IRenderingOptions options, int[] slides)
Returns a Thumbnail Image objects for specified slides of a presentation.
Parameters:
Parameter | Type | Description |
---|---|---|
options | IRenderingOptions | Rendering options. |
slides | int[] | Array with slide positions, starting from 1. |
Returns: com.aspose.slides.IImage[] - Image objects.
getThumbnails(IRenderingOptions options, float scaleX, float scaleY)
public abstract BufferedImage[] getThumbnails(IRenderingOptions options, float scaleX, float scaleY)
Returns a Thumbnail BufferedImage objects for all slides of a presentation with custom scaling.
Parameters:
Parameter | Type | Description |
---|---|---|
options | IRenderingOptions | Rendering options. |
scaleX | float | The value by which to scale this Thumbnail in the x-axis direction. |
scaleY | float | The value by which to scale this Thumbnail in the y-axis direction. |
Returns: java.awt.image.BufferedImage[] - BufferedImage objects.
getImages(IRenderingOptions options, float scaleX, float scaleY)
public abstract IImage[] getImages(IRenderingOptions options, float scaleX, float scaleY)
Returns a Thumbnail Image objects for all slides of a presentation with custom scaling.
Parameters:
Parameter | Type | Description |
---|---|---|
options | IRenderingOptions | Rendering options. |
scaleX | float | The value by which to scale this Thumbnail in the x-axis direction. |
scaleY | float | The value by which to scale this Thumbnail in the y-axis direction. |
Returns: com.aspose.slides.IImage[] - Image objects.
getThumbnails(IRenderingOptions options, int[] slides, float scaleX, float scaleY)
public abstract BufferedImage[] getThumbnails(IRenderingOptions options, int[] slides, float scaleX, float scaleY)
Returns a Thumbnail BufferedImage objects for specified slides of a presentation with custom scaling.
Parameters:
Parameter | Type | Description |
---|---|---|
options | IRenderingOptions | Rendering options. |
slides | int[] | Array with slide positions, starting from 1. |
scaleX | float | The value by which to scale this Thumbnail in the x-axis direction. |
scaleY | float | The value by which to scale this Thumbnail in the y-axis direction. |
Returns: java.awt.image.BufferedImage[] - BufferedImage objects.
getImages(IRenderingOptions options, int[] slides, float scaleX, float scaleY)
public abstract IImage[] getImages(IRenderingOptions options, int[] slides, float scaleX, float scaleY)
Returns a Thumbnail Image objects for specified slides of a presentation with custom scaling.
Parameters:
Parameter | Type | Description |
---|---|---|
options | IRenderingOptions | Rendering options. |
slides | int[] | Array with slide positions, starting from 1. |
scaleX | float | The value by which to scale this Thumbnail in the x-axis direction. |
scaleY | float | The value by which to scale this Thumbnail in the y-axis direction. |
Returns: com.aspose.slides.IImage[] - Image objects.
getThumbnails(IRenderingOptions options, Dimension imageSize)
public abstract BufferedImage[] getThumbnails(IRenderingOptions options, Dimension imageSize)
Returns a Thumbnail BufferedImage objects for all slides of a presentation with specified size.
Parameters:
Parameter | Type | Description |
---|---|---|
options | IRenderingOptions | Rendering options. |
imageSize | java.awt.Dimension | Size of the image to create. |
Returns: java.awt.image.BufferedImage[] - BufferedImage objects.
getImages(IRenderingOptions options, Dimension imageSize)
public abstract IImage[] getImages(IRenderingOptions options, Dimension imageSize)
Returns a Thumbnail Image objects for all slides of a presentation with specified size.
Parameters:
Parameter | Type | Description |
---|---|---|
options | IRenderingOptions | Rendering options. |
imageSize | java.awt.Dimension | Size of the image to create. |
Returns: com.aspose.slides.IImage[] - Image objects.
getThumbnails(IRenderingOptions options, int[] slides, Dimension imageSize)
public abstract BufferedImage[] getThumbnails(IRenderingOptions options, int[] slides, Dimension imageSize)
Returns a Thumbnail Bitmap objects for specified slides of a presentation with specified size.
Parameters:
Parameter | Type | Description |
---|---|---|
options | IRenderingOptions | Rendering options. |
slides | int[] | Array with slide positions, starting from 1. |
imageSize | java.awt.Dimension | Size of the image to create. |
Returns: java.awt.image.BufferedImage[] - Bitmap objects.
getImages(IRenderingOptions options, int[] slides, Dimension imageSize)
public abstract IImage[] getImages(IRenderingOptions options, int[] slides, Dimension imageSize)
Returns a Thumbnail Image objects for specified slides of a presentation with specified size.
Parameters:
Parameter | Type | Description |
---|---|---|
options | IRenderingOptions | Rendering options. |
slides | int[] | Array with slide positions, starting from 1. |
imageSize | java.awt.Dimension | Size of the image to create. |
Returns: com.aspose.slides.IImage[] - Image objects.
getSlideById(long id)
public abstract IBaseSlide getSlideById(long id)
Returns a Slide, MasterSlide or LayoutSlide by Id.
Parameters:
Parameter | Type | Description |
---|---|---|
id | long | Id of a slide. |
Returns: IBaseSlide - IBaseSlide object.
joinPortionsWithSameFormatting()
public abstract void joinPortionsWithSameFormatting()
Joins runs with same formatting in all paragraphs in all acceptable shapes in all slides.
highlightText(String text, Color highlightColor)
public abstract void highlightText(String text, Color highlightColor)
Highlights all matches of the sample text with the specified color.
The following code sample shows how to highlight text in a PowerPoint presentation. Presentation presentation = new Presentation("SomePresentation.pptx"); try { // highlighting all separate 'the' occurrences presentation.highlightText("the", Color.MAGENTA); presentation.save("SomePresentation-out2.pptx", SaveFormat.Pptx); } finally { if (presentation != null) presentation.dispose(); }
Parameters:
Parameter | Type | Description |
---|---|---|
text | java.lang.String | The text to highlight. |
highlightColor | java.awt.Color | The color to highlight the text. |
highlightText(String text, Color highlightColor, ITextSearchOptions options, IFindResultCallback callback)
public abstract void highlightText(String text, Color highlightColor, ITextSearchOptions options, IFindResultCallback callback)
Highlights all matches of the sample text with the specified color.
The following code sample shows how to highlight text in a PowerPoint presentation. Presentation presentation = new Presentation("SomePresentation.pptx"); try { // highlighting all separate 'the' occurrences presentation.highlightText("the", Color.MAGENTA); presentation.save("SomePresentation-out2.pptx", SaveFormat.Pptx); } finally { if (presentation != null) presentation.dispose(); }
Parameters:
Parameter | Type | Description |
---|---|---|
text | java.lang.String | The text to highlight. |
highlightColor | java.awt.Color | The color to highlight the text. |
options | ITextSearchOptions | Text search options ITextSearchOptions. |
callback | IFindResultCallback | The callback object for receiving search results IFindResultCallback. |
highlightRegex(Pattern regex, Color highlightColor, IFindResultCallback callback)
public abstract void highlightRegex(Pattern regex, Color highlightColor, IFindResultCallback callback)
Highlights all matches of the regular expression with the specified color.
The following code sample shows how to highlight text in a PowerPoint Presentation using a regular expression. Presentation presentation = new Presentation("SomePresentation.pptx"); try { // highlighting all separate 'the' occurrences presentation.highlightText("the", Color.MAGENTA); presentation.save("SomePresentation-out2.pptx", SaveFormat.Pptx); } finally { if (presentation != null) presentation.dispose(); }
Parameters:
Parameter | Type | Description |
---|---|---|
regex | java.util.regex.Pattern | The regular expression java.util.regex.Pattern to get strings to highlight. |
highlightColor | java.awt.Color | The color to highlight the text. |
callback | IFindResultCallback | The callback object for receiving search results IFindResultCallback. |
replaceText(String oldText, String newText, ITextSearchOptions options, IFindResultCallback callback)
public abstract void replaceText(String oldText, String newText, ITextSearchOptions options, IFindResultCallback callback)
Replaces all occurrences of the specified text with another specified text.
The following sample code shows how to replace one specified string with another specified string. Presentation presentation = new Presentation("SomePresentation.pptx") try { TextSearchOptions textSearchOptions = new TextSearchOptions(); textSearchOptions.setWholeWordsOnly(true); // Replace all separate 'the' occurrences with '***' presentation.replaceText("the", "***", textSearchOptions, null); presentation.save("SomePresentation-out2.pptx", SaveFormat.Pptx); } finally { if (presentation != null) presentation.dispose(); }
Parameters:
Parameter | Type | Description |
---|---|---|
oldText | java.lang.String | The string to be replaced. |
newText | java.lang.String | The string to replace all occurrences of oldText. |
options | ITextSearchOptions | Text search options ITextSearchOptions. |
callback | IFindResultCallback | The callback object for receiving search results IFindResultCallback. |
replaceRegex(Pattern regex, String newText, IFindResultCallback callback)
public abstract void replaceRegex(Pattern regex, String newText, IFindResultCallback callback)
Replaces all matches of the regular expression with the specified string.
The following code sample shows how to replace text using regular expression with the specified string. Presentation presentation = new Presentation("SomePresentation.pptx") try { TextSearchOptions textSearchOptions = new TextSearchOptions(); textSearchOptions.setWholeWordsOnly(true); // Replace all separate 'the' occurrences with '***' presentation.replaceText("the", "***", textSearchOptions, null); presentation.save("SomePresentation-out2.pptx", SaveFormat.Pptx); } finally { if (presentation != null) presentation.dispose(); }
Parameters:
Parameter | Type | Description |
---|---|---|
regex | java.util.regex.Pattern | The regular expression java.util.regex.Pattern to get strings to replace. |
newText | java.lang.String | The string to replace all occurrences of the strings to be replaced. |
callback | IFindResultCallback | The callback object for receiving search results IFindResultCallback. |