Aspose::Slides::Util::SlideUtil Class Reference

Offer methods which help to search shapes and text in a presentation. More...

Static Public Member Functions

static System::SharedPtr< IShapeFindShape (System::SharedPtr< IPresentation > pres, System::String altText)
 Find shape by alternative text in a PPTX presentation. More...
 
static System::SharedPtr< IShapeFindShape (System::SharedPtr< IBaseSlide > slide, System::String altText)
 Find shape by alternative text on a slide in a PPTX presentation. More...
 
static void AlignShapes (ShapesAlignmentType alignmentType, bool alignToSlide, System::SharedPtr< IShapeCollection > shapes)
 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. More...
 
static void AlignShapes (ShapesAlignmentType alignmentType, bool alignToSlide, System::SharedPtr< IBaseSlide > slide, System::ArrayPtr< int32_t > 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. More...
 
static System::ArrayPtr< System::SharedPtr< ITextFrame > > GetAllTextBoxes (System::SharedPtr< IBaseSlide > slide)
 Returns all text frames on a slide in a PPTX presentation. More...
 
static System::ArrayPtr< System::SharedPtr< ITextFrame > > GetAllTextFrames (System::SharedPtr< IPresentation > pres, bool withMasters)
 Returns all text frames in a PPTX presentation. More...
 

Detailed Description

Offer methods which help to search shapes and text in a presentation.

Member Function Documentation

◆ AlignShapes() [1/2]

static void Aspose::Slides::Util::SlideUtil::AlignShapes ( ShapesAlignmentType  alignmentType,
bool  alignToSlide,
System::SharedPtr< IShapeCollection shapes 
)
static

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.

Parameters
alignmentTypeDetermines which type of alignment will be applied.
alignToSlideIf true, shapes will be aligned relative to the slide edges
shapesShapes collection to be aligned

Example:

auto pres = System::MakeObject<Presentation>(u"pres.pptx");
SlideUtil::AlignShapes(Aspose::Slides::ShapesAlignmentType::AlignBottom, true, pres->get_Slides()->idx_get(0)->get_Shapes());

◆ AlignShapes() [2/2]

static void Aspose::Slides::Util::SlideUtil::AlignShapes ( ShapesAlignmentType  alignmentType,
bool  alignToSlide,
System::SharedPtr< IBaseSlide slide,
System::ArrayPtr< int32_t shapeIndexes 
)
static

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.

Parameters
alignmentTypeDetermines which type of alignment will be applied.
alignToSlideIf true, shapes will be aligned relative to the slide edges
slideParent slide.
shapeIndexesIndexes of shapes to be aligned.

Example:

auto pres = System::MakeObject<Presentation>(u"pres.pptx");
auto slide = pres->get_Slides()->idx_get(0);
auto shape1 = slide->get_Shapes()->idx_get(0);
auto shape2 = slide->get_Shapes()->idx_get(1);
System::MakeArray<int32_t>({
slide->get_Shapes()->IndexOf(shape1),
slide->get_Shapes()->IndexOf(shape2)
}));

◆ FindShape() [1/2]

static System::SharedPtr<IShape> Aspose::Slides::Util::SlideUtil::FindShape ( System::SharedPtr< IPresentation pres,
System::String  altText 
)
static

Find shape by alternative text in a PPTX presentation.

Parameters
presScanned presentation.
altTextAlternative text of a shape.
Returns
Shape or null.

◆ FindShape() [2/2]

static System::SharedPtr<IShape> Aspose::Slides::Util::SlideUtil::FindShape ( System::SharedPtr< IBaseSlide slide,
System::String  altText 
)
static

Find shape by alternative text on a slide in a PPTX presentation.

Parameters
slideScanned slide.
altTextAlternative text of a shape.
Returns
Shape or null.

◆ GetAllTextBoxes()

static System::ArrayPtr<System::SharedPtr<ITextFrame> > Aspose::Slides::Util::SlideUtil::GetAllTextBoxes ( System::SharedPtr< IBaseSlide slide)
static

Returns all text frames on a slide in a PPTX presentation.

Parameters
slideScanned slide.
Returns
Array of TextFrame objects.

◆ GetAllTextFrames()

static System::ArrayPtr<System::SharedPtr<ITextFrame> > Aspose::Slides::Util::SlideUtil::GetAllTextFrames ( System::SharedPtr< IPresentation pres,
bool  withMasters 
)
static

Returns all text frames in a PPTX presentation.

Parameters
presScanned presentation.
withMastersDetermines whether master slides should be scanned.
Returns
Array of TextFrame objects.