public class SlideUtil
extends java.lang.Object
Offer methods which help to search shapes and text in a presentation.
Constructor and Description |
---|
SlideUtil() |
Modifier and Type | Method and Description |
---|---|
static void |
alignShapes(int alignmentType,
boolean alignToSlide,
IBaseSlide slide)
Changes the placement of all shapes on the slide.
|
static void |
alignShapes(int alignmentType,
boolean alignToSlide,
IBaseSlide slide,
int[] shapeIndexes)
Changes the placement of selected shapes on the slide.
|
static void |
alignShapes(int alignmentType,
boolean alignToSlide,
IGroupShape groupShape)
Changes the placement of all shapes within group shape.
|
static void |
alignShapes(int alignmentType,
boolean alignToSlide,
IGroupShape groupShape,
int[] shapeIndexes)
Changes the placement of selected shapes within group shape.
|
static void |
alignShapes(int alignmentType,
boolean alignToSlide,
IShapeCollection shapes)
Deprecated.
Use Slide.Util.SlideUtil.AlignShapes with IBaseSlide or IGroupShape overloads instead. The method will be removed after release of version 21.7.
|
static IShape |
findShape(IBaseSlide slide,
java.lang.String altText)
Find shape by alternative text on a slide in a PPTX presentation.
|
static IShape |
findShape(IPresentation pres,
java.lang.String altText)
Find shape by alternative text in a PPTX presentation.
|
static ITextFrame[] |
getAllTextBoxes(IBaseSlide slide)
Returns all text frames on a slide in a PPTX presentation.
|
static ITextFrame[] |
getAllTextFrames(IPresentation pres,
boolean withMasters)
Returns all text frames in a PPTX presentation.
|
public static IShape findShape(IPresentation pres, java.lang.String altText)
Find shape by alternative text in a PPTX presentation.
pres
- Scanned presentation.altText
- Alternative text of a shape.public static IShape findShape(IBaseSlide slide, java.lang.String altText)
Find shape by alternative text on a slide in a PPTX presentation.
slide
- Scanned slide.altText
- Alternative text of a shape.@Deprecated public static void alignShapes(int alignmentType, boolean alignToSlide, IShapeCollection shapes)
Changes the placement of all shapes in the collection. Aligns shapes to the margins or the edge of the slide or align them relative to each other.
Example:Presentation pres = new Presentation("pres.pptx"); try { SlideUtil.alignShapes(ShapesAlignmentType.AlignBottom, true, pres.getSlides().get_Item(0).getShapes()); } finally { if (pres != null) pres.dispose(); }
alignmentType
- Determines which type of alignment will be applied.alignToSlide
- If true, shapes will be aligned relative to the slide edgesshapes
- Shapes collection to be alignedpublic static void alignShapes(int alignmentType, boolean alignToSlide, IBaseSlide slide)
Changes the placement of all shapes on the slide. Aligns shapes to the margins or the edge of the slide or align them relative to each other.
Example:Presentation pres = new Presentation("pres.pptx"); try { SlideUtil.alignShapes(ShapesAlignmentType.AlignBottom, true, pres.getSlides().get_Item(0)); } finally { if (pres != null) pres.dispose(); }
alignmentType
- Determines which type of alignment will be applied.alignToSlide
- If true, shapes will be aligned relative to the slide edges.slide
- Parent slide.public static void alignShapes(int alignmentType, boolean alignToSlide, IBaseSlide slide, int[] shapeIndexes)
Changes the placement of selected shapes on the slide. Aligns shapes to the margins or the edge of the slide or align them relative to each other.
Example:Presentation pres = new Presentation("pres.pptx"); try { ISlide slide = pres.getSlides().get_Item(0); IShape shape1 = slide.getShapes().get_Item(0); IShape shape2 = slide.getShapes().get_Item(1); SlideUtil.alignShapes(ShapesAlignmentType.AlignBottom, false, pres.getSlides().get_Item(0), new int[] { slide.getShapes().indexOf(shape1), slide.getShapes().indexOf(shape2) }); } finally { if (pres != null) pres.dispose(); }
alignmentType
- Determines which type of alignment will be applied.alignToSlide
- If true, shapes will be aligned relative to the slide edges.slide
- Parent slide.shapeIndexes
- Indexes of shapes to be aligned.public static void alignShapes(int alignmentType, boolean alignToSlide, IGroupShape groupShape)
Changes the placement of all shapes within group shape. Aligns shapes to the margins or the edge of the slide or align them relative to each other.
Example:Presentation pres = new Presentation("pres.pptx"); try { ISlide slide = pres.getSlides().get_Item(0); SlideUtil.alignShapes(ShapesAlignmentType.AlignLeft, false, (GroupShape) slide.getShapes().get_Item(0)); } finally { if (pres != null) pres.dispose(); }
alignmentType
- Determines which type of alignment will be applied.alignToSlide
- If true, shapes will be aligned relative to the slide edges.groupShape
- Parent group shape.public static void alignShapes(int alignmentType, boolean alignToSlide, IGroupShape groupShape, int[] shapeIndexes)
Changes the placement of selected shapes within group shape. Aligns shapes to the margins or the edge of the slide or align them relative to each other.
Example:Presentation pres = new Presentation("pres.pptx"); try { ISlide slide = pres.getSlides().get_Item(0); SlideUtil.alignShapes(ShapesAlignmentType.AlignLeft, false, (GroupShape)slide.getShapes().get_Item(0), new int[] { 0, 2 }); } finally { if (pres != null) pres.dispose(); }
alignmentType
- Determines which type of alignment will be applied.alignToSlide
- If true, shapes will be aligned relative to the slide edges.groupShape
- Parent group shape.shapeIndexes
- Indexes of shapes to be aligned.public static ITextFrame[] getAllTextBoxes(IBaseSlide slide)
Returns all text frames on a slide in a PPTX presentation.
slide
- Scanned slide.TextFrame
objects.public static ITextFrame[] getAllTextFrames(IPresentation pres, boolean withMasters)
Returns all text frames in a PPTX presentation.
pres
- Scanned presentation.withMasters
- Determines whether master slides should be scanned.TextFrame
objects.