Delete Slides Introduction
Aspose.Slides Cloud allows you to delete slides from a PowerPoint presentation. Using the request methods below, you can delete a single slide, multiple slides with specified indexes, or all slides at once.
DeleteSlide
API
Type
Description
Resource
/slides/{name}/slides/{slideIndex}
DELETE
Deletes a slide from a presentation at the specified index.
DeleteSlide
Request Parameters
Name
Type
Location
Required
Description
name
string
path
true
The file name of a presentation.
slideIndex
integer
path
true
The 1-based index of the slide to be deleted.
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
Delete the first slide from MyFolder/MyPresentation.pptx document that contains three slides and was saved to MyStorage .
cURL Solution
SDK Solutions
C#
Copy
using Aspose.Slides.Cloud.Sdk ;
using System ;
class Application
{
static void Main ( )
{
SlidesApi api = new SlidesApi ( "MyClientId" , "MyClientSecret" );
var response = api . DeleteSlide ( "MyPresentation.pptx" , 1 , null );
foreach ( var slide in response . SlideList )
{
Console . WriteLine ( slide . Href );
}
}
}
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 ( "my_client_id" , "my_client_secret" );
Slides response = slidesApi . deleteSlide ( "MyPresentation.pptx" , 1 , null , "MyFolder" , "MyStorage" );
for ( ResourceUri slide : response . getSlideList ()) {
System . out . println ( slide . getHref ());
}
}
}
PHP
Copy
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 );
$response = $slidesApi -> deleteSlide ( "MyPresentation.pptx" , 1 , null , "MyFolder" , "MyStorage" );
foreach ( $response -> getSlideList () as $slide )
{
echo $slide -> getHref (), " \n " ;
}
Ruby
Copy
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 )
response = slides_api . delete_slide ( "MyPresentation.pptx" , 1 , nil , "MyFolder" , "MyStorage" )
for slide in response . slide_list
puts slide . href
end
Python
Copy
import asposeslidescloud
from asposeslidescloud.apis.slides_api import SlidesApi
slides_api = SlidesApi ( None , "my_client_id" , "my_client_secret" )
response = slides_api . delete_slide ( "MyPresentation.pptx" , 1 , None , "MyFolder" , "MyStorage" )
for slide in response . slide_list :
print ( slide . href )
Node.js
Copy
const cloud = require ( "asposeslidescloud" );
const slidesApi = new cloud . SlidesApi ( "my_client_id" , "my_client_secret" );
slidesApi . deleteSlide ( "MyPresentation.pptx" , 1 , null , "MyFolder" , "MyStorage" ). then ( response => {
response . body . slideList . forEach ( slide => {
console . log ( slide . href );
});
});
Android
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 ( "my_client_id" , "my_client_secret" );
Slides response = slidesApi . deleteSlide ( "MyPresentation.pptx" , 1 , null , "MyFolder" , "MyStorage" );
for ( ResourceUri slide : response . getSlideList ()) {
System . out . println ( slide . getHref ());
}
}
}
C++
Copy
#include "asposeslidescloud/api/SlidesApi.h"
using namespace asposeslidescloud :: api ;
int main ()
{
auto slidesApi = new SlidesApi ( L "my_client_id" , L "my_client_secret" );
auto response = slidesApi -> deleteSlide ( L "MyPresentation.pptx" , 1 , L "" , L "MyFolder" , L "MyStorage" ). get ();
for ( auto slide : response -> getSlideList ()) {
std :: wcout << slide -> getHref () << std :: endl ;
}
return 0 ;
}
Perl
Copy
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 );
my %parameters = ( name => "MyPresentation.pptx" , slide_index => 1 , folder => "MyFolder" , storage => "MyStorage" );
my $response = $slides_api -> delete_slide ( %parameters );
for $slide ( @ { $response -> { slide_list }}) {
print $slide -> { href }, "\n" ;
}
Swift
Go
DeleteSlides
API
Type
Description
Resource
/slides/{name}/slides
DELETE
Deletes slides from a presentation at the specified indices.
DeleteSlides
Request Parameters
Name
Type
Location
Required
Description
name
string
path
true
The file name of a presentation.
slides
string
query
false
The 1-based indices of the slides to be deleted. If the indices are not specified, all slides are deleted and one blank slide is added.
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
Delete the slides with indices 1, 3, 5 from MyPresentation.pptx document that contains five slides and was saved in the default storage root folder. Use my_password string to open the presentation.
cURL Solution
SDK Solutions
C#
Copy
using Aspose.Slides.Cloud.Sdk ;
using System ;
using System.Collections.Generic ;
class Application
{
static void Main ( )
{
SlidesApi api = new SlidesApi ( "my_client_id" , "my_client_secret" );
var slideIndices = new List < int > { 1 , 3 , 5 };
var response = api . DeleteSlides ( "MyPresentation.pptx" , slideIndices );
foreach ( var slide in response . SlideList )
{
Console . WriteLine ( slide . Href );
}
}
}
Java
Copy
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" );
ArrayList slideIndices = new ArrayList ( Arrays . asList ( 1 , 3 , 5 ));
Slides response = slidesApi . deleteSlides ( "MyPresentation.pptx" , slideIndices , "my_password" , null , null );
for ( ResourceUri slide : response . getSlideList ()) {
System . out . println ( slide . getHref ());
}
}
}
PHP
Copy
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 );
$response = $slidesApi -> deleteSlides ( "MyPresentation.pptx" , [ 1 , 3 , 5 ], "my_password" );
foreach ( $response -> getSlideList () as $slide )
{
echo $slide -> getHref (), " \n " ;
}
Ruby
Copy
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 )
response = slides_api . delete_slides ( "MyPresentation.pptx" , [ 1 , 3 , 5 ] , "my_password" )
for slide in response . slide_list
puts slide . href
end
Python
Copy
import asposeslidescloud
from asposeslidescloud.apis.slides_api import SlidesApi
slides_api = SlidesApi ( None , "my_client_id" , "my_client_secret" )
response = slides_api . delete_slides ( "MyPresentation.pptx" , [ 1 , 3 , 5 ], "my_password" )
for slide in response . slide_list :
print ( slide . href )
Node.js
Copy
const cloud = require ( "asposeslidescloud" );
const slidesApi = new cloud . SlidesApi ( "my_client_id" , "my_client_secret" );
slidesApi . deleteSlides ( "MyPresentation.pptx" , [ 1 , 3 , 5 ], "my_password" ). then ( response => {
response . body . slideList . forEach ( slide => {
console . log ( slide . href );
});
});
Android
Copy
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" );
ArrayList slideIndices = new ArrayList ( Arrays . asList ( 1 , 3 , 5 ));
Slides response = slidesApi . deleteSlides ( "MyPresentation.pptx" , slideIndices , "my_password" , null , null );
for ( ResourceUri slide : response . getSlideList ()) {
System . out . println ( slide . getHref ());
}
}
}
C++
Copy
#include "asposeslidescloud/api/SlidesApi.h"
using namespace asposeslidescloud :: api ;
int main ()
{
auto slidesApi = new SlidesApi ( L "my_client_id" , L "my_client_secret" );
auto response = slidesApi -> deleteSlides ( L "MyPresentation.pptx" , { 1 , 3 , 5 }, L "my_password" ). get ();
for ( auto slide : response -> getSlideList ()) {
std :: wcout << slide -> getHref () << std :: endl ;
}
return 0 ;
}
Perl
Copy
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 );
my @slide_indices = ( 1 , 3 , 5 );
my %parameters = ( name => "MyPresentation.pptx" , slides => \ @slide_indices , password => "my_password" );
my $response = $slides_api -> delete_slides ( %parameters );
for $slide ( @ { $response -> { slide_list }}) {
print $slide -> { 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.