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

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

Public Member Functions

 SlideUtil ()=delete
 

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 all shapes in the collection. 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)
 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. 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 void AlignShapes (ShapesAlignmentType alignmentType, bool alignToSlide, System::SharedPtr< 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. More...
 
static void AlignShapes (ShapesAlignmentType alignmentType, bool alignToSlide, System::SharedPtr< IGroupShape > groupShape, System::ArrayPtr< int32_t > 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. 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.

Constructor & Destructor Documentation

◆ SlideUtil()

Aspose::Slides::Util::SlideUtil::SlideUtil ( )
delete

Member Function Documentation

◆ AlignShapes() [1/5]

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

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.

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

Example:

System::SharedPtr<Presentation> pres = System::MakeObject<Presentation>(u"pres.pptx");
static void AlignShapes(ShapesAlignmentType alignmentType, bool alignToSlide, System::SharedPtr< IShapeCollection > shapes)
Changes the placement of all shapes in the collection. Aligns shapes to the margins or the edge of th...
Pointer class to wrap types being allocated on heap. Use it to manage memory for classes inheriting O...
Definition: smart_ptr.h:93

◆ AlignShapes() [2/5]

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)
}));

◆ AlignShapes() [3/5]

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

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.

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

Example:

System::SharedPtr<Presentation> pres = System::MakeObject<Presentation>(u"pres.pptx");
SlideUtil::AlignShapes(Aspose::Slides::ShapesAlignmentType::AlignLeft, false, System::DynamicCast<Aspose::Slides::GroupShape>(pres->get_Slides()->idx_get(0)->get_Shapes()));

◆ AlignShapes() [4/5]

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

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.

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

Example:

System::SharedPtr<Presentation> pres = System::MakeObject<Presentation>(u"pres.pptx");
SlideUtil::AlignShapes(Aspose::Slides::ShapesAlignmentType::AlignLeft, false, System::DynamicCast<Aspose::Slides::GroupShape>(pres->get_Slides()->idx_get(0)->get_Shapes()->idx_get(0)), System::MakeArray<int32_t>({0, 2}));

◆ AlignShapes() [5/5]

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

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.

Deprecated:
Use Slide.Util.SlideUtil.AlignShapes with IBaseSlide or IGroupShape overloads instead. The method will be removed after release of version 21.7.
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());

◆ FindShape() [1/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.

◆ FindShape() [2/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.

◆ 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.