PHP에서 프레젠테이션 줌 관리

소개

PowerPoint 줌을 사용하면 슬라이드 쇼 중에 특정 슬라이드 및 섹션 사이를 탐색할 수 있습니다. Aspose.Slides for PHP via Java를 사용하면 슬라이드, 섹션 및 요약 줌을 만들고 미리 보기, 테두리 및 전환을 사용자 지정할 수 있습니다.

PowerPoint 줌 개요

  • 전체 프레젠테이션을 하나의 슬라이드에 요약하려면 요약 줌을 사용합니다.
  • 선택한 슬라이드만 표시하려면 슬라이드 줌을 사용합니다.
  • 단일 섹션만 표시하려면 섹션 줌을 사용합니다.

슬라이드 줌

슬라이드 줌은 프레젠테이션을 보다 역동적으로 만들 수 있으며, 원하는 순서대로 슬라이드 사이를 자유롭게 탐색하면서 프레젠테이션 흐름을 방해하지 않습니다. 슬라이드 줌은 섹션이 많지 않은 짧은 프레젠테이션에 적합하지만 다양한 프레젠테이션 시나리오에서도 사용할 수 있습니다.

슬라이드 줌을 사용하면 단일 개요 슬라이드에서 관련 정보를 탐색할 수 있습니다.

슬라이드 줌을 위한 슬라이드 선택

슬라이드 줌 개체의 경우, Aspose.Slides는 ZoomImageType 열거형, ZoomFrame 클래스 및 ShapeCollection 클래스의 메서드를 제공합니다.

Zoom 프레임 만들기

ShapeCollection::addZoomFrame을 사용하여 개요 슬라이드에 개별 슬라이드에 대한 링크를 배치합니다. 이 예제는 서로 다른 배경과 레이블을 가진 두 개의 대상 슬라이드를 만든 다음 각 슬라이드의 미리 보기를 첫 번째 슬라이드에 추가하고 프레젠테이션을 PPTX로 저장합니다. 프레임 위치와 크기는 포인트 단위로 지정됩니다.

use aspose\slides\BackgroundType;
use aspose\slides\FillType;
use aspose\slides\Presentation;
use aspose\slides\SaveFormat;
use aspose\slides\ShapeType;

$presentation = new Presentation();
try {
    $overviewSlide = $presentation->getSlides()->get_Item(0);

    $secondSlide = $presentation->getSlides()->addEmptySlide($overviewSlide->getLayoutSlide());
    $thirdSlide = $presentation->getSlides()->addEmptySlide($overviewSlide->getLayoutSlide());

    $secondSlide->getBackground()->setType(BackgroundType::OwnBackground);
    $secondSlide->getBackground()->getFillFormat()->setFillType(FillType::Solid);
    $secondSlide->getBackground()->getFillFormat()->getSolidFillColor()->setColor(java("java.awt.Color")->CYAN);

    $textBox = $secondSlide->getShapes()->addAutoShape(ShapeType::Rectangle, 100, 200, 500, 200);
    $textBox->getTextFrame()->setText("Second Slide");

    $thirdSlide->getBackground()->setType(BackgroundType::OwnBackground);
    $thirdSlide->getBackground()->getFillFormat()->setFillType(FillType::Solid);
    $color = new Java("java.awt.Color", 189, 183, 107);
    $thirdSlide->getBackground()->getFillFormat()->getSolidFillColor()->setColor($color);

    $textBox = $thirdSlide->getShapes()->addAutoShape(ShapeType::Rectangle, 100, 200, 500, 200);
    $textBox->getTextFrame()->setText("Third Slide");

    $overviewSlide->getShapes()->addZoomFrame(20, 20, 250, 200, $secondSlide);
    $overviewSlide->getShapes()->addZoomFrame(200, 250, 250, 200, $thirdSlide);

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

맞춤 이미지로 Zoom 프레임 만들기

맞춤 이미지를 ShapeCollection::addZoomFrame에 전달하여 대상 슬라이드의 기본 미리 보기를 교체합니다. 이 예제는 로컬 이미지를 필요로 하며, Images::fromFile으로 이미지를 로드하고 ImageCollection::addImage를 사용해 프레젠테이션에 추가합니다. 결과 프레임은 해당 이미지를 표시하면서 여전히 두 번째 슬라이드에 연결됩니다.

use aspose\slides\BackgroundType;
use aspose\slides\FillType;
use aspose\slides\Images;
use aspose\slides\Presentation;
use aspose\slides\SaveFormat;
use aspose\slides\ShapeType;

$presentation = new Presentation();
try {
    $overviewSlide = $presentation->getSlides()->get_Item(0);

    $slide = $presentation->getSlides()->addEmptySlide($overviewSlide->getLayoutSlide());
    $slide->getBackground()->setType(BackgroundType::OwnBackground);
    $slide->getBackground()->getFillFormat()->setFillType(FillType::Solid);
    $slide->getBackground()->getFillFormat()->getSolidFillColor()->setColor(java("java.awt.Color")->CYAN);

    $textBox = $slide->getShapes()->addAutoShape(ShapeType::Rectangle, 100, 200, 500, 200);
    $textBox->getTextFrame()->setText("Second Slide");
    $image = Images::fromFile("image.png");
    try {
        $previewImage = $presentation->getImages()->addImage($image);
    } finally {
        $image->dispose();
    }

    $overviewSlide->getShapes()->addZoomFrame(20, 20, 300, 200, $slide, $previewImage);

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

Zoom 프레임 형식 지정

이 예제는 두 개의 슬라이드 줌 프레임을 사용자 지정합니다. 첫 번째 프레임에는 ZoomObject::setZoomImage를 통해 로컬 이미지를 할당하고, 두 번째 프레임에는 Shape::getLineFormat을 사용하여 5포인트 점선-점선 분홍색 테두리를 적용합니다. false를 ZoomObject::setShowBackground에 전달하면 두 번째 프레임의 배경이 숨겨집니다. 맞춤 미리 보기를 위해 로컬 이미지가 필요하며, 두 프레임 모두 저장된 PPTX에서 슬라이드 대상이 유지됩니다.

use aspose\slides\BackgroundType;
use aspose\slides\FillType;
use aspose\slides\Images;
use aspose\slides\LineDashStyle;
use aspose\slides\Presentation;
use aspose\slides\SaveFormat;
use aspose\slides\ShapeType;

$presentation = new Presentation();
try {
    $overviewSlide = $presentation->getSlides()->get_Item(0);

    $secondSlide = $presentation->getSlides()->addEmptySlide($overviewSlide->getLayoutSlide());
    $thirdSlide = $presentation->getSlides()->addEmptySlide($overviewSlide->getLayoutSlide());

    $secondSlide->getBackground()->setType(BackgroundType::OwnBackground);
    $secondSlide->getBackground()->getFillFormat()->setFillType(FillType::Solid);
    $secondSlide->getBackground()->getFillFormat()->getSolidFillColor()->setColor(java("java.awt.Color")->CYAN);

    $textBox = $secondSlide->getShapes()->addAutoShape(ShapeType::Rectangle, 100, 200, 500, 200);
    $textBox->getTextFrame()->setText("Second Slide");

    $thirdSlide->getBackground()->setType(BackgroundType::OwnBackground);
    $thirdSlide->getBackground()->getFillFormat()->setFillType(FillType::Solid);
    $color = new Java("java.awt.Color", 189, 183, 107);
    $thirdSlide->getBackground()->getFillFormat()->getSolidFillColor()->setColor($color);

    $textBox = $thirdSlide->getShapes()->addAutoShape(ShapeType::Rectangle, 100, 200, 500, 200);
    $textBox->getTextFrame()->setText("Third Slide");

    $firstZoomFrame = $overviewSlide->getShapes()->addZoomFrame(20, 20, 250, 200, $secondSlide);
    $secondZoomFrame = $overviewSlide->getShapes()->addZoomFrame(200, 250, 250, 200, $thirdSlide);
    $image = Images::fromFile("image.png");
    try {
        $previewImage = $presentation->getImages()->addImage($image);
    } finally {
        $image->dispose();
    }

    $firstZoomFrame->setZoomImage($previewImage);

    $secondZoomFrame->getLineFormat()->setWidth(5);
    $secondZoomFrame->getLineFormat()->getFillFormat()->setFillType(FillType::Solid);
    $color = new Java("java.awt.Color", 255, 105, 180);
    $secondZoomFrame->getLineFormat()->getFillFormat()->getSolidFillColor()->setColor($color);
    $secondZoomFrame->getLineFormat()->setDashStyle(LineDashStyle::DashDot);

    $secondZoomFrame->setShowBackground(false);

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

섹션 줌

섹션 줌은 프레젠테이션의 섹션에 연결됩니다. 이를 사용하여 주제를 다시 살펴보거나 프레젠테이션의 다양한 부분이 어떻게 연결되는지 표시할 수 있습니다.

섹션 줌을 위한 섹션 선택

섹션 줌 개체의 경우, Aspose.Slides는 SectionZoomFrame 클래스와 ShapeCollection 클래스의 메서드를 제공합니다.

섹션 줌 프레임 만들기

SectionCollection::addSection으로 섹션을 만든 다음 반환된 섹션을 ShapeCollection::addSectionZoomFrame에 전달합니다. 이 예제는 첫 번째 슬라이드에 섹션 줌을 배치하고 색상이 있는 슬라이드로 시작하는 섹션에 연결합니다. 프레임의 위치와 크기는 포인트 단위로 지정되며, 프레젠테이션은 PPTX로 저장됩니다.

use aspose\slides\BackgroundType;
use aspose\slides\FillType;
use aspose\slides\Presentation;
use aspose\slides\SaveFormat;

$presentation = new Presentation();
try {
    $overviewSlide = $presentation->getSlides()->get_Item(0);

    $slide = $presentation->getSlides()->addEmptySlide($overviewSlide->getLayoutSlide());
    $slide->getBackground()->getFillFormat()->setFillType(FillType::Solid);
    $color = new Java("java.awt.Color", 154, 205, 50);
    $slide->getBackground()->getFillFormat()->getSolidFillColor()->setColor($color);
    $slide->getBackground()->setType(BackgroundType::OwnBackground);

    $section = $presentation->getSections()->addSection("Section 1", $slide);
    $sectionZoomFrame = $overviewSlide->getShapes()->addSectionZoomFrame(20, 20, 300, 200, $section);

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

맞춤 이미지로 섹션 줌 프레임 만들기

ShapeCollection::addSectionZoomFrame의 이미지 오버로드를 사용하면 대상 섹션을 변경하지 않고 맞춤 미리 보기를 표시할 수 있습니다. 이 예제는 로컬 이미지를 필요로 하며, Images::fromFile으로 이미지를 로드하고 ImageCollection::addImage를 통해 추가합니다. 저장된 프레젠테이션에는 첫 번째 슬라이드에 새로 만든 섹션에 연결된 섹션 줌이 포함됩니다.

use aspose\slides\BackgroundType;
use aspose\slides\FillType;
use aspose\slides\Images;
use aspose\slides\Presentation;
use aspose\slides\SaveFormat;

$presentation = new Presentation();
try {
    $overviewSlide = $presentation->getSlides()->get_Item(0);

    $slide = $presentation->getSlides()->addEmptySlide($overviewSlide->getLayoutSlide());
    $slide->getBackground()->getFillFormat()->setFillType(FillType::Solid);
    $color = new Java("java.awt.Color", 154, 205, 50);
    $slide->getBackground()->getFillFormat()->getSolidFillColor()->setColor($color);
    $slide->getBackground()->setType(BackgroundType::OwnBackground);
    $image = Images::fromFile("image.png");
    try {
        $previewImage = $presentation->getImages()->addImage($image);
    } finally {
        $image->dispose();
    }

    $section = $presentation->getSections()->addSection("Section 1", $slide);
    $sectionZoomFrame = $overviewSlide->getShapes()->addSectionZoomFrame(20, 20, 300, 200, $section, $previewImage);

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

섹션 줌의 대상 섹션 변경

SectionZoomFrame::setTargetSection을 사용하면 기존 섹션 줌을 다시 만들지 않고 대상 섹션을 재지정할 수 있습니다. 동일한 프레젠테이션의 Presentation::getSections 컬렉션에서 채워진 섹션을 선택합니다. 빈 섹션을 할당하면 현재 대상이 변경되지 않으므로 할당하기 전에 Section::getSlidesListOfSection을 확인하십시오. 섹션에 대한 자세한 내용은 Manage Slide Sections를 참고하세요.

다음 예제는 여러 개의 채워진 섹션, Section navigation이라는 기존 섹션 줌, 그리고 고유 이름 Results를 가진 섹션을 포함해야 하는 프레젠테이션 파일을 로드합니다. 이 코드는 모든 슬라이드를 검색하여 줌을 찾고, 섹션 순서가 바뀔 때 변할 수 있는 컬렉션 인덱스가 아니라 이름으로 목적지를 찾습니다. 이름이 고유하지 않은 경우 Section::getSectionId를 사용하여 목적지를 식별하십시오.

use aspose\slides\Presentation;
use aspose\slides\SaveFormat;

$presentation = new Presentation("section-zoom.pptx");
try {
    $zoom = null;
    $slideCount = java_values($presentation->getSlides()->size());
    for ($i = 0; $i < $slideCount; $i++) {
        $slide = $presentation->getSlides()->get_Item($i);
        $shapeCount = java_values($slide->getShapes()->size());
        for ($j = 0; $j < $shapeCount; $j++) {
            $shape = $slide->getShapes()->get_Item($j);
            if (java_instanceof($shape, new JavaClass("com.aspose.slides.ISectionZoomFrame")) && java_values($shape->getName()) === "Section navigation") {
                $zoom = $shape;
                break;
            }
        }
        if ($zoom != null) {
            break;
        }
    }

    $targetSection = null;
    $sectionCount = java_values($presentation->getSections()->size());
    for ($i = 0; $i < $sectionCount; $i++) {
        $section = $presentation->getSections()->get_Item($i);
        if (java_values($section->getName()) === "Results") {
            $targetSection = $section;
            break;
        }
    }

    if ($zoom == null || $targetSection == null) {
        echo "The section zoom or destination section was not found.", PHP_EOL;
    } else if (java_values($targetSection->getSlidesListOfSection()->size()) == 0) {
        echo "The destination section is empty.", PHP_EOL;
    } else {
        $currentSection = $zoom->getTargetSection();
        echo "Current section: " . (java_is_null($currentSection) ? "" : java_values($currentSection->getName())), PHP_EOL;
        $zoom->setTargetSection($targetSection);
        $presentation->save("section-zoom-updated.pptx", SaveFormat::Pptx);
    }
} finally {
    $presentation->dispose();
}

섹션 줌 프레임 형식 지정

이 예제는 섹션 줌을 100×75 포인트로 이동 및 크기 조정하고, ZoomObject::setZoomImage를 통해 로컬 이미지를 지정하며, 2.5포인트 점선-점선 갈색 테두리를 적용합니다. 섹션 후 원본 슬라이드로 돌아가도록 ZoomObject::setReturnToParent를 활성화하고, ZoomObject::setShowBackground를 비활성화하며, ZoomObject::setTransitionDuration를 1.5초로 설정합니다. 맞춤 미리 보기를 위해 로컬 이미지가 필요합니다.

use aspose\slides\BackgroundType;
use aspose\slides\FillType;
use aspose\slides\Images;
use aspose\slides\LineDashStyle;
use aspose\slides\Presentation;
use aspose\slides\SaveFormat;

$presentation = new Presentation();
try {
    $overviewSlide = $presentation->getSlides()->get_Item(0);

    $slide = $presentation->getSlides()->addEmptySlide($overviewSlide->getLayoutSlide());
    $slide->getBackground()->getFillFormat()->setFillType(FillType::Solid);
    $color = new Java("java.awt.Color", 154, 205, 50);
    $slide->getBackground()->getFillFormat()->getSolidFillColor()->setColor($color);
    $slide->getBackground()->setType(BackgroundType::OwnBackground);

    $section = $presentation->getSections()->addSection("Section 1", $slide);

    $sectionZoomFrame = $overviewSlide->getShapes()->addSectionZoomFrame(20, 20, 300, 200, $section);
    $sectionZoomFrame->setX(100);
    $sectionZoomFrame->setY(300);
    $sectionZoomFrame->setWidth(100);
    $sectionZoomFrame->setHeight(75);
    $image = Images::fromFile("image.png");
    try {
        $previewImage = $presentation->getImages()->addImage($image);
    } finally {
        $image->dispose();
    }

    $sectionZoomFrame->setZoomImage($previewImage);

    $sectionZoomFrame->setReturnToParent(true);
    $sectionZoomFrame->setShowBackground(false);

    $sectionZoomFrame->getLineFormat()->getFillFormat()->setFillType(FillType::Solid);
    $color = new Java("java.awt.Color", 165, 42, 42);
    $sectionZoomFrame->getLineFormat()->getFillFormat()->getSolidFillColor()->setColor($color);
    $sectionZoomFrame->getLineFormat()->setDashStyle(LineDashStyle::DashDot);
    $sectionZoomFrame->getLineFormat()->setWidth(2.5);

    $sectionZoomFrame->setTransitionDuration(1.5);

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

요약 줌

요약 줌은 프레젠테이션 섹션의 개요를 제공합니다. 슬라이드 쇼 중에 섹션으로 이동하거나, 앞으로 건너뛰거나, 슬라이드 순서를 따르지 않고 주제를 다시 살펴볼 수 있습니다.

요약 줌을 위한 섹션 선택

요약 줌 개체의 경우, Aspose.Slides는 SummaryZoomFrame, SummaryZoomSection, SummaryZoomSectionCollection 클래스와 ShapeCollection 클래스의 메서드를 제공합니다.

요약 줌 만들기

ShapeCollection::addSummaryZoomFrame을 사용하여 프레젠테이션 섹션의 개요를 생성합니다. 이 예제는 서로 다른 슬라이드 배경을 가진 네 개의 섹션을 만들고 첫 번째 슬라이드에 요약 줌을 추가합니다. 프레임 위치와 크기는 포인트 단위로 지정되며, 결과 개요는 PPTX 프레젠테이션으로 저장됩니다.

use aspose\slides\BackgroundType;
use aspose\slides\FillType;
use aspose\slides\Presentation;
use aspose\slides\SaveFormat;

$presentation = new Presentation();
try {
    $overviewSlide = $presentation->getSlides()->get_Item(0);

    $slide = $presentation->getSlides()->addEmptySlide($overviewSlide->getLayoutSlide());
    $slide->getBackground()->getFillFormat()->setFillType(FillType::Solid);
    $color = new Java("java.awt.Color", 165, 42, 42);
    $slide->getBackground()->getFillFormat()->getSolidFillColor()->setColor($color);
    $slide->getBackground()->setType(BackgroundType::OwnBackground);

    $presentation->getSections()->addSection("Section 1", $slide);

    $slide = $presentation->getSlides()->addEmptySlide($overviewSlide->getLayoutSlide());
    $slide->getBackground()->getFillFormat()->setFillType(FillType::Solid);
    $slide->getBackground()->getFillFormat()->getSolidFillColor()->setColor(java("java.awt.Color")->CYAN);
    $slide->getBackground()->setType(BackgroundType::OwnBackground);

    $presentation->getSections()->addSection("Section 2", $slide);

    $slide = $presentation->getSlides()->addEmptySlide($overviewSlide->getLayoutSlide());
    $slide->getBackground()->getFillFormat()->setFillType(FillType::Solid);
    $color = new Java("java.awt.Color", 127, 255, 0);
    $slide->getBackground()->getFillFormat()->getSolidFillColor()->setColor($color);
    $slide->getBackground()->setType(BackgroundType::OwnBackground);

    $presentation->getSections()->addSection("Section 3", $slide);

    $slide = $presentation->getSlides()->addEmptySlide($overviewSlide->getLayoutSlide());
    $slide->getBackground()->getFillFormat()->setFillType(FillType::Solid);
    $color = new Java("java.awt.Color", 0, 100, 0);
    $slide->getBackground()->getFillFormat()->getSolidFillColor()->setColor($color);
    $slide->getBackground()->setType(BackgroundType::OwnBackground);

    $presentation->getSections()->addSection("Section 4", $slide);

    $summaryZoomFrame = $overviewSlide->getShapes()->addSummaryZoomFrame(150, 50, 300, 200);

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

요약 줌 섹션 추가 및 제거

요약 줌은 SummaryZoomSection 객체를 SummaryZoomFrame::getSummaryZoomCollection에 저장합니다. 이 예제는 두 개 섹션의 개요를 만든 뒤 SummaryZoomSectionCollection::addSummaryZoomSection을 사용해 세 번째 섹션을 추가하고, SummaryZoomSectionCollection::removeSummaryZoomSection을 사용해 첫 번째 섹션의 항목을 제거합니다. 항목을 제거해도 프레젠테이션 섹션 및 해당 슬라이드는 그대로 유지됩니다.

use aspose\slides\BackgroundType;
use aspose\slides\FillType;
use aspose\slides\Presentation;
use aspose\slides\SaveFormat;

$presentation = new Presentation();
try {
    $overviewSlide = $presentation->getSlides()->get_Item(0);

    $slide = $presentation->getSlides()->addEmptySlide($overviewSlide->getLayoutSlide());
    $slide->getBackground()->getFillFormat()->setFillType(FillType::Solid);
    $color = new Java("java.awt.Color", 165, 42, 42);
    $slide->getBackground()->getFillFormat()->getSolidFillColor()->setColor($color);
    $slide->getBackground()->setType(BackgroundType::OwnBackground);

    $firstSection = $presentation->getSections()->addSection("Section 1", $slide);

    $slide = $presentation->getSlides()->addEmptySlide($overviewSlide->getLayoutSlide());
    $slide->getBackground()->getFillFormat()->setFillType(FillType::Solid);
    $slide->getBackground()->getFillFormat()->getSolidFillColor()->setColor(java("java.awt.Color")->CYAN);
    $slide->getBackground()->setType(BackgroundType::OwnBackground);

    $presentation->getSections()->addSection("Section 2", $slide);

    $summaryZoomFrame = $overviewSlide->getShapes()->addSummaryZoomFrame(150, 50, 300, 200);

    $slide = $presentation->getSlides()->addEmptySlide($overviewSlide->getLayoutSlide());
    $slide->getBackground()->getFillFormat()->setFillType(FillType::Solid);
    $color = new Java("java.awt.Color", 127, 255, 0);
    $slide->getBackground()->getFillFormat()->getSolidFillColor()->setColor($color);
    $slide->getBackground()->setType(BackgroundType::OwnBackground);

    $thirdSection = $presentation->getSections()->addSection("Section 3", $slide);

    $summaryZoomFrame->getSummaryZoomCollection()->addSummaryZoomSection($thirdSection);

    $summaryZoomFrame->getSummaryZoomCollection()->removeSummaryZoomSection($firstSection);

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

요약 줌 섹션 형식 지정

이 예제는 SummaryZoomFrame::getSummaryZoomCollection에서 첫 번째 항목(0 기반 인덱스 0)을 형식화합니다. ZoomObject::setZoomImage를 위해 로컬 이미지가 필요하며, 1.5포인트 점선-점선 검은색 테두리를 적용하고, ZoomObject::setTransitionDuration를 1.5초로 설정합니다. false를 ZoomObject::setReturnToParent에 전달하면 이 항목에 대해 요약 슬라이드로 자동 반환이 비활성화됩니다.

use aspose\slides\BackgroundType;
use aspose\slides\FillType;
use aspose\slides\Images;
use aspose\slides\LineDashStyle;
use aspose\slides\Presentation;
use aspose\slides\SaveFormat;

$presentation = new Presentation();
try {
    $overviewSlide = $presentation->getSlides()->get_Item(0);

    $slide = $presentation->getSlides()->addEmptySlide($overviewSlide->getLayoutSlide());
    $slide->getBackground()->getFillFormat()->setFillType(FillType::Solid);
    $color = new Java("java.awt.Color", 165, 42, 42);
    $slide->getBackground()->getFillFormat()->getSolidFillColor()->setColor($color);
    $slide->getBackground()->setType(BackgroundType::OwnBackground);

    $presentation->getSections()->addSection("Section 1", $slide);

    $slide = $presentation->getSlides()->addEmptySlide($overviewSlide->getLayoutSlide());
    $slide->getBackground()->getFillFormat()->setFillType(FillType::Solid);
    $slide->getBackground()->getFillFormat()->getSolidFillColor()->setColor(java("java.awt.Color")->CYAN);
    $slide->getBackground()->setType(BackgroundType::OwnBackground);

    $presentation->getSections()->addSection("Section 2", $slide);

    $summaryZoomFrame = $overviewSlide->getShapes()->addSummaryZoomFrame(150, 50, 300, 200);

    $summarySection = $summaryZoomFrame->getSummaryZoomCollection()->get_Item(0);
    $image = Images::fromFile("image.png");
    try {
        $previewImage = $presentation->getImages()->addImage($image);
    } finally {
        $image->dispose();
    }

    $summarySection->setZoomImage($previewImage);
    $summarySection->setReturnToParent(false);

    $summarySection->getLineFormat()->getFillFormat()->setFillType(FillType::Solid);
    $summarySection->getLineFormat()->getFillFormat()->getSolidFillColor()->setColor(java("java.awt.Color")->BLACK);
    $summarySection->getLineFormat()->setDashStyle(LineDashStyle::DashDot);
    $summarySection->getLineFormat()->setWidth(1.5);

    $summarySection->setTransitionDuration(1.5);

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

FAQ

대상 표시 후 ‘부모’ 슬라이드로 반환을 제어할 수 있나요?

예. 대상 콘텐츠가 표시된 후 원본 슬라이드로 돌아가려면 true와 함께 ZoomObject::setReturnToParent를 호출하십시오.

Zoom 전환의 ‘속도’ 또는 지속 시간을 조정할 수 있나요?

예. 전환 지속 시간을 초 단위로 제어하려면 ZoomObject::setTransitionDuration를 사용하십시오.

프레젠테이션에 포함될 수 있는 Zoom 개체 수에 제한이 있나요?

문서에 명시된 엄격한 API 제한은 없습니다. 실제 제한은 전체 프레젠테이션의 복잡도와 뷰어 성능에 따라 달라집니다. 많은 Zoom 프레임을 추가할 수 있지만 파일 크기와 렌더링 시간을 고려하십시오.