ForEach
Contents
[
Hide
]ForEach class
Represents a group of methods intended to iterate over different Presentation model objects. These methods can be useful if you need to iterate and change some Presentation’ elements formatting or content, e.g. change each portion formatting.
class ForEach
Methods
Typedefs
Typedef | Description |
---|---|
ForEachSlideCallback | Callback that will be invoked for each ForEach::Slide in the Presentation. |
ForEachMasterSlideCallback | Callback that will be invoked for each ForEach::MasterSlide in the Presentation. |
ForEachLayoutSlideCallback | Callback that will be invoked for each ForEach::LayoutSlide in the Presentation. |
ForEachShapeCallback | Callback that will be invoked for each ForEach::Shape in the Presentation. |
ForEachParagraphCallback | Callback that will be invoked for each ForEach::Paragraph on the BaseSlide. |
ForEachPortionCallback | Callback that will be invoked for each ForEach::Portion in the ForEach::Paragraph on the BaseSlide. |
Remarks
auto presentation = System::MakeObject<Presentation>(u"pres.pptx");
auto lambda = [](SharedPtr<Portion> portion, SharedPtr<Paragraph> para, SharedPtr<BaseSlide> slide, int32_t index) -> void
{
portion->get_PortionFormat()->set_LatinFont(System::MakeObject<FontData>(u"Times New Roman"));
};
auto callback = std::function<void(SharedPtr<Portion> portion, SharedPtr<Paragraph> para, SharedPtr<BaseSlide> slide, int32_t index)>(lambda);
ForEach::Portion(presentation, callback);
presentation->Save(u"pres-out.pptx", SaveFormat::Pptx);
See Also
- Namespace Aspose::Slides::LowCode
- Library Aspose.Slides