Read Information about Layout Slides Introduction
Slide layouts contain formatting, positioning, and placeholder boxes for all of the content that appears on a slide. The following method allows you to read information of all layout slides from a PowerPoint presentation.
GetLayoutSlides
API
Type
Description
Resource
/slides/{name}/layoutSlides
GET
Reads information of layout slides from a presentation.
GetLayoutSlides
Request Parameters
Name
Type
Location
Required
Description
name
string
path
true
The name of a presentation file.
password
string
header
false
The password to open the presentation.
folder
string
query
false
The path to the folder containing the presentation.
storage
string
query
false
The name of the storage contaning the folder
.
In case of Amazon S3 storage folder path starts with Amazon S3 bucket name.
Examples
Read titles of layout slides from the document MyFolder/MyPresentation.pptx saved to the default storage.
cURL Solution
Request
Get an Access Token
Copy curl -X POST "https://api.aspose.cloud/connect/token" \
-d "grant_type=client_credentials&client_id=MyClientId&client_secret=MyClientSecret" \
-H "Content-Type: application/x-www-form-urlencoded"
Read Information of Layout Slides
Copy curl -X GET "https://api.aspose.cloud/v3.0/slides/MyPresentation.pptx/layoutSlides?folder=MyFolder" \
-H "authorization: Bearer MyAccessToken"
Response
Response Example
Copy {
"slideList" : [
{
"href" : "https://api.aspose.cloud/v3.0/slides/MyPresentation.pptx/layoutSlides/1?folder=MyFolder" ,
"relation" : "self" ,
"title" : "Title Slide, Type: Title"
},
{
"href" : "https://api.aspose.cloud/v3.0/slides/MyPresentation.pptx/layoutSlides/2?folder=MyFolder" ,
"relation" : "self" ,
"title" : "Title and Content, Type: TitleAndObject"
},
{
"href" : "https://api.aspose.cloud/v3.0/slides/MyPresentation.pptx/layoutSlides/3?folder=MyFolder" ,
"relation" : "self" ,
"title" : "Section Header, Type: SectionHeader"
}
],
"selfUri" : {
"href" : "https://api.aspose.cloud/v3.0/slides/MyPresentation.pptx/layoutSlides?folder=MyFolder" ,
"relation" : "self"
}
}
SDK Solutions
C#
Copy
using Aspose.Slides.Cloud.Sdk ;
using System ;
class Application
{
static void Main ( string [] args )
{
var slidesApi = new SlidesApi ( "MyClientId" , "MyClientSecret" );
var layoutSlides = slidesApi . GetLayoutSlides ( "MyPresentation.pptx" , null , "MyFolder" );
foreach ( var slide in layoutSlides . SlideList )
{
Console . WriteLine ( slide . Title );
}
}
}
Java
Copy
import com.aspose.slides.ApiException ;
import com.aspose.slides.api.SlidesApi ;
public class Application {
public static void main ( String [] args ) throws ApiException {
SlidesApi slidesApi = new SlidesApi ( "MyClientId" , "MyClientSecret" );
LayoutSlides layoutSlides = slidesApi . getLayoutSlides ( "MyPresentation.pptx" , null , "MyFolder" , null );
for ( ResourceUri slide : layoutSlides . getSlideList ()) {
System . out . println ( slide . getTitle ());
}
}
}
PHP
Copy
use Aspose \Slides \Cloud \Sdk \Api \Configuration ;
use Aspose \Slides \Cloud \Sdk \Api \SlidesApi ;
$configuration = new Configuration ();
$configuration -> setAppSid ( "MyClientId" );
$configuration -> setAppKey ( "MyClientSecret" );
$slidesApi = new SlidesApi ( null , $configuration );
$layoutSlides = $slidesApi -> getLayoutSlides ( "MyPresentation.pptx" , null , "MyFolder" );
foreach ( $layoutSlides -> getSlideList () as $slide ) {
echo $slide -> getTitle (), PHP_EOL ;
}
Ruby
Copy
require "aspose_slides_cloud"
include AsposeSlidesCloud
configuration = Configuration . new
configuration . app_sid = "MyClientId"
configuration . app_key = "MyClientSecret"
slides_api = SlidesApi . new ( configuration )
layout_slides = slides_api . get_layout_slides ( "MyPresentation.pptx" , nil , "MyFolder" )
for slide in layout_slides . slide_list
puts slide . title
end
Python
Copy
import asposeslidescloud
from asposeslidescloud.apis.slides_api import SlidesApi
slides_api = SlidesApi ( None , "MyClientId" , "MyClientSecret" )
layout_slides = slides_api . get_layout_slides ( "MyPresentation.pptx" , None , "MyFolder" )
for slide in layout_slides . slide_list :
print ( slide . title )
Node.js
Copy
const cloud = require ( "asposeslidescloud" );
const slidesApi = new cloud . SlidesApi ( "MyClientId" , "MyClientSecret" );
slidesApi . getLayoutSlides ( "MyPresentation.pptx" , null , "MyFolder" ). then ( layoutSlides => {
layoutSlides . body . slideList . forEach ( slide => {
console . log ( slide . title );
});
});
C++
Copy
#include "asposeslidescloud/api/SlidesApi.h"
using namespace asposeslidescloud :: api ;
int main ()
{
auto slidesApi = std :: make_shared < SlidesApi > ( L "MyClientId" , L "MyClientSecret" );
auto layoutSlides = slidesApi -> getLayoutSlides ( L "MyPresentation.pptx" , L "" , L "MyFolder" ). get ();
for ( auto slide : layoutSlides -> getSlideList ()) {
std :: wcout << slide -> getTitle () << std :: endl ;
}
return 0 ;
}
Perl
Copy
use AsposeSlidesCloud::Configuration ;
use AsposeSlidesCloud::SlidesApi ;
my $config = AsposeSlidesCloud::Configuration -> new ();
$config -> { app_sid } = "MyClientId" ;
$config -> { app_key } = "MyClientSecret" ;
my $slides_api = AsposeSlidesCloud::SlidesApi -> new ( config => $config );
my %parameters = ( name => "MyPresentation.pptx" , folder => "MyFolder" );
my $layout_slides = $slides_api -> get_layout_slides ( %parameters );
for my $slide ( @ { $layout_slides -> { slide_list }}) {
print ( $slide -> { title }, "\n" );
}
Swift
Go
SDKs
Check Available SDKs to learn how to add an SDK to your project.