Move a Slide Introduction
Aspose.Slides Cloud lets you move a slide to a new position within a PowerPoint presentation. The following methods allow you to both move a single slide and change the order of multiple slides at the same time.
MoveSlide
API
Type
Description
Resource
/slides/{name}/slides/{slideIndex}/move
POST
Moves a presentation slide to a new position.
MoveSlide
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 the slide to be moved.
newPosition
integer
query
true
The new index for the slide.
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
MyFolder/MyPresentation.pptx file saved to MyStorage contains four slides. Move the third slide to the first position.
cURL Solution
SDK Solutions
C#
// For complete examples and data files, please go to https://github.com/aspose-Slides-cloud/aspose-Slides-cloud-dotnet
using Aspose.Slides.Cloud.Sdk ;
using System ;
class Application
{
static void Main ()
{
SlidesApi api = new SlidesApi ( "MyClientId" , "MyClientSecret" );
// Move the third slide to the first position.
var response = api . MoveSlide ( "MyPresentation.pptx" , 3 , 1 );
// Print links to all slides.
foreach ( var resourceUri in response . SlideList )
{
// Output: https://api.aspose.cloud/v3.0/slides/MyPresentation.pptx/slides/1 etc.
Console . WriteLine ( resourceUri . Href );
}
}
}
Java
// For complete examples and data files, please go to https://github.com/aspose-Slides-cloud/aspose-Slides-cloud-java
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 ( "my_client_id" , "my_client_secret" );
// Move the third slide to the first position.
Slides response = slidesApi . moveSlide ( "MyPresentation.pptx" , 3 , 1 , null , "MyFolder" , "MyStorage" );
// Print links to all slides.
for ( ResourceUri resourceUri : response . getSlideList ()) {
// Output: https://api.aspose.cloud/v3.0/slides/MyPresentation.pptx/slides/1?folder=MyFolder etc.
System . out . println ( resourceUri . getHref ());
}
}
}
PHP
// For complete examples and data files, please go to https://github.com/aspose-Slides-cloud/aspose-Slides-cloud-php
use Aspose\Slides\Cloud\Sdk\Api\Configuration ;
use Aspose\Slides\Cloud\Sdk\Api\SlidesApi ;
$configuration = new Configuration ();
$configuration -> setAppSid ( "my_client_id" );
$configuration -> setAppKey ( "my_client_secret" );
$slidesApi = new SlidesApi ( null , $configuration );
// Move the third slide to the first position.
$response = $slidesApi -> moveSlide ( "MyPresentation.pptx" , 3 , 1 , null , "MyFolder" , "MyStorage" );
// Print links to all slides.
foreach ( $response -> getSlideList () as $resourceUri ) {
// Output: https://api.aspose.cloud/v3.0/slides/MyPresentation.pptx/slides/1?folder=MyFolder etc.
echo $resourceUri -> getHref (), " \n " ;
}
Ruby
# For complete examples and data files, please go to https://github.com/aspose-Slides-cloud/aspose-Slides-cloud-ruby
require "aspose_slides_cloud"
include AsposeSlidesCloud
configuration = Configuration . new
configuration . app_sid = "my_client_id"
configuration . app_key = "my_client_secret"
slides_api = SlidesApi . new ( configuration )
# Move the third slide to the first position.
response = slides_api . move_slide ( "MyPresentation.pptx" , 3 , 1 , nil , "MyFolder" , "MyStorage" )
# Print links to all slides.
for resource_uri in response . slide_list
# Output: https://api.aspose.cloud/v3.0/slides/MyPresentation.pptx/slides/1?folder=MyFolder etc.
puts resource_uri . href
end
Python
# For complete examples and data files, please go to https://github.com/aspose-Slides-cloud/aspose-Slides-cloud-python
import asposeslidescloud
from asposeslidescloud.apis.slides_api import SlidesApi
slides_api = SlidesApi ( None , "my_client_id" , "my_client_secret" )
# Move the third slide to the first position.
response = slides_api . move_slide ( "MyPresentation.pptx" , 3 , 1 , None , "MyFolder" , "MyStorage" )
# Print links to all slides.
for resource_uri in response . slide_list :
# Output: https://api.aspose.cloud/v3.0/slides/MyPresentation.pptx/slides/1?folder=MyFolder etc.
print ( resource_uri . href )
Node.js
// For complete examples and data files, please go to https://github.com/aspose-Slides-cloud/aspose-Slides-cloud-nodejs
const cloud = require ( "asposeslidescloud" );
const slidesApi = new cloud . SlidesApi ( "my_client_id" , "my_client_secret" );
// Move the third slide to the first position.
slidesApi . moveSlide ( "MyPresentation.pptx" , 3 , 1 , null , "MyFolder" , "MyStorage" ). then ( response => {
// Print links to all slides.
response . body . slideList . forEach ( resourceUri => {
// Output: https://api.aspose.cloud/v3.0/slides/MyPresentation.pptx/slides/1?folder=MyFolder etc.
console . log ( resourceUri . href );
});
});
Android
// For complete examples and data files, please go to https://github.com/aspose-Slides-cloud/aspose-Slides-cloud-android
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 ( "my_client_id" , "my_client_secret" );
// Move the third slide to the first position.
Slides response = slidesApi . moveSlide ( "MyPresentation.pptx" , 3 , 1 , null , "MyFolder" , "MyStorage" );
// Print links to all slides.
for ( ResourceUri resourceUri : response . getSlideList ()) {
// Output: https://api.aspose.cloud/v3.0/slides/MyPresentation.pptx/slides/1?folder=MyFolder etc.
System . out . println ( resourceUri . getHref ());
}
}
}
C++
// For complete examples and data files, please go to https://github.com/aspose-Slides-cloud/aspose-Slides-cloud-cpp
#include "asposeslidescloud/api/SlidesApi.h"
using namespace asposeslidescloud :: api ;
int main ()
{
auto slidesApi = new SlidesApi ( L "my_client_id" , L "my_client_secret" );
// Move the third slide to the first position.
auto response = slidesApi -> moveSlide ( L "MyPresentation.pptx" , 3 , 1 , L "" , L "MyFolder" , L "MyStorage" ). get ();
// Print links to all slides.
for ( auto resourceUri : response -> getSlideList ()) {
// Output: https://api.aspose.cloud/v3.0/slides/MyPresentation.pptx/slides/1?folder=MyFolder etc.
std :: wcout << resourceUri -> getHref () << std :: endl ;
}
return 0 ;
}
Perl
# For complete examples and data files, please go to https://github.com/aspose-Slides-cloud/aspose-Slides-cloud-perl
use AsposeSlidesCloud::Configuration ;
use AsposeSlidesCloud::SlidesApi ;
my $config = AsposeSlidesCloud::Configuration -> new ();
$config -> { app_sid } = "my_client_id" ;
$config -> { app_key } = "my_client_secret" ;
my $slides_api = AsposeSlidesCloud::SlidesApi -> new ( config => $config );
# Move the third slide to the first position.
my %parameters = ( name => "MyPresentation.pptx" , slide_index => 3 , new_position => 1 , folder => "MyFolder" , storage => "MyStorage" );
my $response = $slides_api -> move_slide ( %parameters );
# Print links to all slides.
for my $resource_uri ( @ { $response -> { slide_list }}) {
# Output: https://api.aspose.cloud/v3.0/slides/MyPresentation.pptx/slides/1?folder=MyFolder etc.
print $resource_uri -> { href }, "\n" ;
}
Swift
Go
ReorderSlides
API
Type
Description
Resource
/slides/{name}/slides/reorder
POST
Changes the order of presentation slides.
ReorderSlides
Request Parameters
Name
Type
Location
Required
Description
name
string
path
true
The name of a presentation file.
oldPositions
string
query
false
A comma separated array of 1-based indices of slides to be reordered.
newPositions
string
query
false
A comma separated array of new slide positions.
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
MyFolder/MyPresentation.pptx file saved to MyStorage contains three slides. Swap the first and last slides.
cURL Solution
SDK Solutions
C#
// For complete examples and data files, please go to https://github.com/aspose-Slides-cloud/aspose-Slides-cloud-dotnet
using Aspose.Slides.Cloud.Sdk ;
using System ;
using System.Collections.Generic ;
class Application
{
static void Main ()
{
SlidesApi api = new SlidesApi ( "MyClientId" , "MyClientSecret" );
// Swap the first and third slides.
var slideIndices = new List < int > { 1 , 3 };
var newPositions = new List < int > { 3 , 1 };
var response = api . ReorderSlides ( "MyPresentation.pptx" , slideIndices , newPositions );
// Print links to all slides.
foreach ( var resourceUri in response . SlideList )
{
// Output: https://api.aspose.cloud/v3.0/slides/MyPresentation.pptx/slides/1?folder=MyFolder etc.
Console . WriteLine ( resourceUri . Href );
}
}
}
Java
// For complete examples and data files, please go to https://github.com/aspose-Slides-cloud/aspose-Slides-cloud-java
import com.aspose.slides.ApiException ;
import com.aspose.slides.api.SlidesApi ;
import java.util.Arrays ;
public class Application {
public static void main ( String [] args ) throws ApiException {
SlidesApi api = new SlidesApi ( "MyClientId" , "MyClientSecret" );
// Swap the first and third slides.
ArrayList slideIndices = new ArrayList ( Arrays . asList ( 1 , 3 ));
ArrayList newPositions = new ArrayList ( Arrays . asList ( 3 , 1 ));
Slides response = api . reorderSlides ( "MyPresentation.pptx" , slideIndices , newPositions , null , null , null );
// Print links to all slides.
for ( ResourceUri resourceUri : response . getSlideList ()) {
// Output: https://api.aspose.cloud/v3.0/slides/MyPresentation.pptx/slides/1 etc.
System . out . println ( resourceUri . getHref ());
}
}
}
PHP
// For complete examples and data files, please go to https://github.com/aspose-Slides-cloud/aspose-Slides-cloud-php
use Aspose\Slides\Cloud\Sdk\Api\Configuration ;
use Aspose\Slides\Cloud\Sdk\Api\SlidesApi ;
$configuration = new Configuration ();
$configuration -> setAppSid ( "my_client_id" );
$configuration -> setAppKey ( "my_client_secret" );
$slidesApi = new SlidesApi ( null , $configuration );
// Swap the first and third slides.
$response = $slidesApi -> reorderSlides ( "MyPresentation.pptx" , [ 1 , 3 ], [ 3 , 1 ], null , "MyFolder" , "MyStorage" );
// Print links to all slides.
foreach ( $response -> getSlideList () as $resourceUri ) {
// Output: https://api.aspose.cloud/v3.0/slides/MyPresentation.pptx/slides/1?folder=MyFolder etc.
echo $resourceUri -> getHref (), " \n " ;
}
Ruby
# For complete examples and data files, please go to https://github.com/aspose-Slides-cloud/aspose-Slides-cloud-ruby
require "aspose_slides_cloud"
include AsposeSlidesCloud
configuration = Configuration . new
configuration . app_sid = "my_client_id"
configuration . app_key = "my_client_secret"
slides_api = SlidesApi . new ( configuration )
# Swap the first and third slides.
response = slides_api . reorder_slides ( "MyPresentation.pptx" , [ 1 , 3 ] , [ 3 , 1 ] , nil , "MyFolder" , "MyStorage" )
# Print links to all slides.
for resource_uri in response . slide_list
# Output: https://api.aspose.cloud/v3.0/slides/MyPresentation.pptx/slides/1?folder=MyFolder etc.
puts resource_uri . href
end
Python
# For complete examples and data files, please go to https://github.com/aspose-Slides-cloud/aspose-Slides-cloud-python
import asposeslidescloud
from asposeslidescloud.apis.slides_api import SlidesApi
slides_api = SlidesApi ( None , "my_client_id" , "my_client_secret" )
# Swap the first and third slides.
response = slides_api . reorder_slides ( "MyPresentation.pptx" , [ 1 , 3 ], [ 3 , 1 ], None , "MyFolder" , "MyStorage" )
# Print links to all slides.
for resource_uri in response . slide_list :
# Output: https://api.aspose.cloud/v3.0/slides/MyPresentation.pptx/slides/1?folder=MyFolder etc.
print ( resource_uri . href )
Node.js
// For complete examples and data files, please go to https://github.com/aspose-Slides-cloud/aspose-Slides-cloud-nodejs
const cloud = require ( "asposeslidescloud" );
const slidesApi = new cloud . SlidesApi ( "my_client_id" , "my_client_secret" );
// Swap the first and third slides.
slidesApi . reorderSlides ( "MyPresentation.pptx" , [ 1 , 3 ], [ 3 , 1 ], null , "MyFolder" , "MyStorage" ). then ( response => {
// Print links to all slides.
response . body . slideList . forEach ( resourceUri => {
// Output: https://api.aspose.cloud/v3.0/slides/MyPresentation.pptx/slides/1?folder=MyFolder etc.
console . log ( resourceUri . href );
});
});
Android
// For complete examples and data files, please go to https://github.com/aspose-Slides-cloud/aspose-Slides-cloud-android
import com.aspose.slides.ApiException ;
import com.aspose.slides.api.SlidesApi ;
import java.util.Arrays ;
public class Application {
public static void main ( String [] args ) throws ApiException {
SlidesApi slidesApi = new SlidesApi ( "my_client_id" , "my_client_secret" );
// Swap the first and third slides.
ArrayList slideIndices = new ArrayList ( Arrays . asList ( 1 , 3 ));
ArrayList newPositions = new ArrayList ( Arrays . asList ( 3 , 1 ));
Slides response = slidesApi . reorderSlides ( "MyPresentation.pptx" , slideIndices , newPositions , null , "MyFolder" , "MyStorage" );
// Print links to all slides.
for ( ResourceUri resourceUri : response . getSlideList ()) {
// Output: https://api.aspose.cloud/v3.0/slides/MyPresentation.pptx/slides/1?folder=MyFolder etc.
System . out . println ( resourceUri . getHref ());
}
}
}
C++
// For complete examples and data files, please go to https://github.com/aspose-Slides-cloud/aspose-Slides-cloud-cpp
#include "asposeslidescloud/api/SlidesApi.h"
using namespace asposeslidescloud :: api ;
int main ()
{
auto slidesApi = new SlidesApi ( L "my_client_id" , L "my_client_secret" );
// Swap the first and third slides.
auto response = slidesApi -> reorderSlides ( L "MyPresentation.pptx" , { 1 , 3 }, { 3 , 1 }, L "" , L "MyFolder" , L "MyStorage" ). get ();
// Print links to all slides.
for ( auto resourceUri : response -> getSlideList ()) {
// Output: https://api.aspose.cloud/v3.0/slides/MyPresentation.pptx/slides/1?folder=MyFolder etc.
std :: wcout << resourceUri -> getHref () << std :: endl ;
}
return 0 ;
}
Perl
# For complete examples and data files, please go to https://github.com/aspose-Slides-cloud/aspose-Slides-cloud-perl
use AsposeSlidesCloud::Configuration ;
use AsposeSlidesCloud::SlidesApi ;
my $config = AsposeSlidesCloud::Configuration -> new ();
$config -> { app_sid } = "my_client_id" ;
$config -> { app_key } = "my_client_secret" ;
my $slides_api = AsposeSlidesCloud::SlidesApi -> new ( config => $config );
# Swap the first and third slides.
my %parameters = ( name => "MyPresentation.pptx" , old_positions => [ 1 , 3 ], new_positions => [ 3 , 1 ], folder => "MyFolder" , storage => "MyStorage" );
my $response = $slides_api -> reorder_slides ( %parameters );
# Print links to all slides.
for my $resource_uri ( @ { $response -> { slide_list }}) {
# Output: https://api.aspose.cloud/v3.0/slides/MyPresentation.pptx/slides/1?folder=MyFolder etc.
print $resource_uri -> { href }, "\n" ;
}
Swift
Go
SDKs
Using an SDK (API client) is the quickest way for a developer to speed up development. An SDK takes care of a lot of low-level details of making requests and handling responses and lets you focus on writing code specific to your particular project. Check out our GitHub repository for a complete list of Aspose.Slides Cloud SDKs along with working examples, to get you started in no time. Please check Available SDKs article to learn how to add an SDK to your project.