Read Animation Properties Introduction
Text, images, shapes, tables, SmartArt graphics, and other objects can be animated in PowerPoint presentations. With Aspose.Slides Cloud, you can read their animation information. Effects can make an object appear, disappear, or move. The following method allows you to specify a slide, shape, or text paragraph to get their animation data.
GetAnimation
API
Type
Description
Resource
/slides/{name}/slides/{slideIndex}/animation
GET
Reads animation information from a PowerPoint object.
GetAnimation
Request Parameters
Name
Type
Location
Required
Description
name
string
path
true
The name of a presentation file.
slideIndex
integer
path
true
The 1-based index of a slide.
shapeIndex
integer
query
false
The 1-based index of a shape. If specified, only effects related to that shape are returned.
paragraphIndex
integer
query
false
The 1-based index of a text paragraph.
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 animations from the first slide contained in MyFolder/MyPresentation.pptx document saved in the default storage.
cURL Solution
Request
Get an Access Token
Copy curl 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"
Get Slide Animations
Copy curl -X GET "https://api.aspose.cloud/v3.0/slides/MyPresentation.pptx/slides/1/animation?folder=MyFolder" \
-H "authorization: Bearer MyAccessToken"
Response
Response Example
Copy {
"mainSequence" : [
{
"type" : "Fade" ,
"subtype" : "None" ,
"presetClassType" : "Entrance" ,
"shapeIndex" : 1 ,
"triggerType" : "OnClick" ,
"duration" : 0.5 ,
"triggerDelayTime" : 0.0
},
{
"type" : "Split" ,
"subtype" : "VerticalIn" ,
"presetClassType" : "Entrance" ,
"shapeIndex" : 2 ,
"triggerType" : "OnClick" ,
"duration" : 1.0 ,
"triggerDelayTime" : 0.0
}
],
"interactiveSequences" : [],
"selfUri" : {
"href" : "https://api.aspose.cloud/v3.0/slides/MyPresentation.pptx/slides/1/animation?folder=MyFolder" ,
"relation" : "self" ,
"slideIndex" : 1
}
}
SDK Solutions
C#
Copy
using Aspose.Slides.Cloud.Sdk ;
using System ;
class Application
{
static void Main ( )
{
var slidesApi = new SlidesApi ( "MyClientId" , "MyClientSecret" );
var slideAnimation = slidesApi . GetAnimation ( "MyPresentation.pptx" , 1 , null , null , null , "MyFolder" );
foreach ( var effect in slideAnimation . MainSequence )
{
Console . WriteLine ( effect . Type );
}
}
}
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" );
SlideAnimation slideAnimation = slidesApi . getAnimation ( "MyPresentation.pptx" , 1 , null , null , null , "MyFolder" , null );
for ( Effect effect : slideAnimation . getMainSequence ()) {
System . out . println ( effect . getType ());
}
}
}
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 );
$slideAnimation = $slidesApi -> getAnimation ( "MyPresentation.pptx" , 1 , null , null , null , "MyFolder" );
foreach ( $slideAnimation -> getMainSequence () as $effect ) {
echo $effect -> getType (), 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 )
slide_animation = slides_api . get_animation ( "MyPresentation.pptx" , 1 , nil , nil , nil , "MyFolder" )
for effect in slide_animation . main_sequence
puts effect . type
end
Python
Copy
import asposeslidescloud
from asposeslidescloud.apis.slides_api import SlidesApi
slides_api = SlidesApi ( None , "MyClientId" , "MyClientSecret" )
slide_animation = slides_api . get_animation ( "MyPresentation.pptx" , 1 , None , None , None , "MyFolder" )
for effect in slide_animation . main_sequence :
print ( effect . type )
Node.js
Copy
const cloud = require ( "asposeslidescloud" );
const slidesApi = new cloud . SlidesApi ( "MyClientId" , "MyClientSecret" );
slidesApi . getAnimation ( "MyPresentation.pptx" , 1 , null , null , null , "MyFolder" ). then ( slideAnimation => {
slideAnimation . body . mainSequence . forEach ( effect => {
console . log ( effect . type );
});
});
C++
Copy
#include "asposeslidescloud/api/SlidesApi.h"
using namespace asposeslidescloud :: api ;
int main ()
{
auto slidesApi = std :: make_shared < SlidesApi > ( L "MyClientId" , L "MyClientSecret" );
auto slideAnimation = slidesApi -> getAnimation ( L "MyPresentation.pptx" , 1 , boost :: none , boost :: none , L "" , L "MyFolder" ). get ();
for ( auto effect : slideAnimation -> getMainSequence ()) {
std :: wcout << effect -> getType () << 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" , slide_index => 1 , folder => "MyFolder" );
my $slide_animation = $slides_api -> get_animation ( %parameters );
for my $effect ( @ { $slide_animation -> { main_sequence }}) {
print ( $effect -> { type } . "\n" );
}
Swift
Go
Copy cfg := asposeslidescloud . NewConfiguration ()
cfg . AppSid = "MyClientId"
cfg . AppKey = "MyClientSecret"
api := asposeslidescloud . NewAPIClient ( cfg )
animation , _ , e := api . SlidesApi . GetAnimation ( "MyPresentation.pptx" , 1 , nil , nil , "" , "MyFolder" , "" )
if e != nil {
fmt . Printf ( "Error: %v." , e )
} else {
for _ , effect := range animation . GetMainSequence () {
fmt . Println ( effect . GetType ())
}
}
SDKs
Check Available SDKs to learn how to add an SDK to your project.