सेक्शन

प्रस्तुति सेक्शन को प्रबंधित करने के उदाहरण — उन्हें प्रोग्रामेटिक रूप से जोड़ना, पहुँच प्राप्त करना, हटाना और पुनः नाम देना Aspose.Slides for PHP via Java का उपयोग करके।

सेक्शन जोड़ें

एक सेक्शन बनाएं जो एक विशिष्ट स्लाइड से शुरू हो।

function addSection() {
    $presentation = new Presentation();
    try {
        $slide = $presentation->getSlides()->get_Item(0);

        // सेक्शन की शुरुआत को चिह्नित करने वाली स्लाइड निर्दिष्ट करें।
        $presentation->getSections()->addSection("New Section", $slide);

        $presentation->save("section.pptx", SaveFormat::Pptx);
    } finally {
        $presentation->dispose();
    }
}

सेक्शन तक पहुँचें

प्रस्तुति से सेक्शन जानकारी पढ़ें।

function accessSection() {
    $presentation = new Presentation("section.pptx");
    try {
        // इंडेक्स द्वारा सेक्शन तक पहुँचें।
        $section = $presentation->getSections()->get_Item(0);
        $sectionName = $section->getName();
    } finally {
        $presentation->dispose();
    }
}

सेक्शन हटाएँ

पहले जोड़ा गया सेक्शन हटाएँ।

function removeSection() {
    $presentation = new Presentation("section.pptx");
    try {
        $section = $presentation->getSections()->get_Item(0);

        // सेक्शन हटाएँ।
        $presentation->getSections()->removeSection($section);

        $presentation->save("section_removed.pptx", SaveFormat::Pptx);
    } finally {
        $presentation->dispose();
    }
}

सेक्शन का नाम बदलें

मौजूदा सेक्शन का नाम बदलें।

function renameSection() {
    $presentation = new Presentation("section.pptx");
    try {
        $section = $presentation->getSections()->get_Item(0);
        $section->setName("New Name");

        $presentation->save("section_renamed.pptx", SaveFormat::Pptx);
    } finally {
        $presentation->dispose();
    }
}