Portion()

ForEach::Portion(System::SharedPtr<Presentation>, ForEach::ForEachPortionCallback) method

Iterate each ForEach::Portion in the Presentation.

static void Aspose::Slides::LowCode::ForEach::Portion(System::SharedPtr<Presentation> pres, ForEach::ForEachPortionCallback forEachPortion)

Arguments

ParameterTypeDescription
presSystem::SharedPtr<Presentation>Presentation to iterate portions
forEachPortionForEach::ForEachPortionCallbackCallback that will be invoked for each portion

Remarks

Portions will be iterated in all type of slides - ForEach::Slide, ForEach::MasterSlide and ForEach::LayoutSlide

auto pres = System::MakeObject<Presentation>(u"pres.pptx");

auto lambda = [](SharedPtr<Portion> portion, SharedPtr<Paragraph> para, SharedPtr<BaseSlide> slide, int32_t index)
{
    System::Console::WriteLine(u"{0}, index: {1}", portion->get_Text(), index);
};
auto callback = std::function<void(SharedPtr<Portion> portion, SharedPtr<Paragraph> para, SharedPtr<BaseSlide> slide, int32_t index)>(lambda);

ForEach::Portion(pres, callback);

ForEach::Portion(System::SharedPtr<Presentation>, bool, ForEach::ForEachPortionCallback) method

Iterate each ForEach::Portion in the Presentation.

static void Aspose::Slides::LowCode::ForEach::Portion(System::SharedPtr<Presentation> pres, bool includeNotes, ForEach::ForEachPortionCallback forEachPortion)

Arguments

ParameterTypeDescription
presSystem::SharedPtr<Presentation>Presentation to iterate portions
includeNotesboolFlag that indicates whether NotesSlides should be included in processing.
forEachPortionForEach::ForEachPortionCallbackCallback that will be invoked for each portion

Remarks

Portions will be iterated in all type of slides - ForEach::Slide, ForEach::MasterSlide, ForEach::LayoutSlide and NotesSlide

auto pres = System::MakeObject<Presentation>(u"pres.pptx");

auto lambda = [](SharedPtr<Portion> portion, SharedPtr<Paragraph> para, SharedPtr<BaseSlide> slide, int32_t index)
{
    System::Console::WriteLine(u"{0}, index: {1}", portion->get_Text(), index);
};
auto callback = std::function<void(SharedPtr<Portion> portion, SharedPtr<Paragraph> para, SharedPtr<BaseSlide> slide, int32_t index)>(lambda);

ForEach::Portion(pres, true, callback);

See Also