Accessing Slides of a Presentation in PHP

Aspose.Slides - Access Slide by Index

To access Slide by Index of a Presentation using Aspose.Slides Java for PHP, call get_slide_by_index method of AccessSlides module. Here you can see example code.

PHP Code


 public static function get_slide_by_index($dataDir=null)

{

\# Instantiate Presentation class that represents the presentation file

$pres = new Presentation($dataDir . 'Aspose.pptx');

\# Accessing a slide using its slide index

$slide = $pres->getSlides()->get_Item(0);

print "Slide: " . $slide . PHP_EOL;

}

Aspose.Slides - Access Slide by ID

To access Slide by ID of a Presentation using Aspose.Slides Java for Ruby, call get_slide_by_id method of AccessSlides module. Here you can see example code.

Ruby Code


 public static function get_slide_by_id($dataDir=null)

{

\# Instantiate Presentation class that represents the presentation file

$pres = new Presentation($dataDir . 'Aspose.pptx');

\# Getting Slide ID

$id = $pres->getSlides()->get_Item(0)->getSlideId();

\# Accessing Slide by ID

$slide = $pres->getSlideById($id);

print "Slide: " . $slide . PHP_EOL;

}

Download Running Code

Download Accessing Slides of a Presentation (Aspose.Slides) from any of the below mentioned social coding sites: