Working with a Slide Background Introduction
Aspose.Slides Cloud API makes it easy to read, update, and delete the background of any slide in a PowerPoint presentation. The presentation must already be saved to a Cloud storage. You can set different background types, such as solid color, gradient, pattern, and image. Many effects can also be applied to the slide background (blur, glow, shadows, reflections, etc.).
GetBackground
API
Type
Description
Resource
/slides/{name}/slides/{slideIndex}/background
GET
Reads information about the background applied to a presentation slide.
GetBackground
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 read the background.
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
Get the background type of the first slide from MyFolder/MyPresentation.pptx file saved to the default storage.
cURL Solution
SDK Solutions
C#
Copy
using Aspose.Slides.Cloud.Sdk ;
using System ;
class Application
{
static void Main ( )
{
var slidesApi = new SlidesApi ( "MyClientId" , "MyClientSecret" );
var slideBackground = slidesApi . GetBackground ( "MyPresentation.pptx" , 1 , null , "MyFolder" );
Console . WriteLine ( slideBackground . 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" );
SlideBackground slideBackground = slidesApi . getBackground ( "MyPresentation.pptx" , 1 , null , "MyFolder" , null );
System . out . println ( slideBackground . 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 );
$slideBackground = $slidesApi -> getBackground ( "MyPresentation.pptx" , 1 , null , "MyFolder" );
echo $slideBackground -> getType ();
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_background = slides_api . get_background ( "MyPresentation.pptx" , 1 , nil , "MyFolder" )
print slide_background . type
Python
Copy
import asposeslidescloud
from asposeslidescloud.apis.slides_api import SlidesApi
slides_api = SlidesApi ( None , "MyClientId" , "MyClientSecret" )
slide_background = slides_api . get_background ( "MyPresentation.pptx" , 1 , None , "MyFolder" )
print ( slide_background . type )
Node.js
Copy
const cloud = require ( "asposeslidescloud" );
const slidesApi = new cloud . SlidesApi ( "MyClientId" , "MyClientSecret" );
slidesApi . getBackground ( "MyPresentation.pptx" , 1 , null , "MyFolder" ). then ( response => {
console . log ( response . body . type );
});
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 ( "MyClientId" , "MyClientSecret" );
slideBackground slideBackground = slidesApi . getBackground ( "MyPresentation.pptx" , 1 , null , "MyFolder" , null );
System . out . println ( slideBackground . getType ());
}
}
C++
Copy
#include "asposeslidescloud/api/SlidesApi.h"
using namespace asposeslidescloud :: api ;
int main ()
{
auto slidesApi = new SlidesApi ( L "MyClientId" , L "MyClientSecret" );
auto slideBackground = slidesApi -> getBackground ( L "MyPresentation.pptx" , 1 , L "" , L "MyFolder" ). get ();
std :: wcout << slideBackground -> getType ();
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_background = $slides_api -> get_background ( %parameters );
print $slide_background -> { type };
Swift
Go
SetBackground
API
Type
Description
Resource
/slides/{name}/slides/{slideIndex}/background
PUT
Sets a background for a presentation slide.
SetBackground
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 set a background.
background
object
body
true
The background DTO. For more information, please see the API Reference and look for the SlideBackground
object.
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.
Background Properties
Name
Type
Description
Type
TypeEnum
The background fill type.
FillFormat
FillFormat
The background fill format.
EffectFormat
EffectFormat
The background effect format.
Background Types (TypeEnum
)
Name
Description
Gradient
Specifies a gradient fill.
NoFill
No fill is applied.
NotDefined
No fill is specified. The background is applied from a slide layout.
Pattern
Specifies a pattern fill.
Picture
Specifies a picture fill.
Solid
Specifies the fill to a solid color.
Examples
Set MyImage.png as the background for the second slide in MyFolder/MyPresentation.pptx document saved to the default storage. Use the Tile fill mode.
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"
Set the Slide Background
Copy curl -X PUT "https://api.aspose.cloud/v3.0/slides/MyPresentation.pptx/slides/2/background?folder=MyFolder" \
-H "authorization: Bearer MyAccessToken" \
-H "Content-Type: application/json" \
-d @request_data.json
request_data.json content:
Copy {
"FillFormat" : {
"Type" : "Picture" ,
"Base64Data" : "iVBORw0KGgoAAAANSUhEUgAAADcAAAAbCAYAAADYtRcLAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAACxEAAAsRAX9kX5EAAAJmSURBVFhH7ZcxTNtAFIZ/mqBYZbDVDmxphtABlZY5HTqnVRFTN1ZnbJduHbuxhBGPdGOqUhVmWjUzhIoBMpBMMKSypSAcOdH17nxnzonjeGmFI3+SlXv3fC/3/P57lhewd0UwpzwQv3NJllxamThzZGtZjNJPJsu0kiWXVpIn13Ww8OUPdhxhp4CEyQ2xc+LCLOXwoeWKuftPsuScAfZtDZvP86hcDnAopu87iZJrdwdolgqo6kv4VHLx+XQoPAIu2WtxqdKlFf9G7VPF/1OpvHODl5HrKFNjMlzUAp8T87DZS1y5Jrkl5l6P1G1hdmyCRp9cCDPe75F6g8W1yQG32b1XpNLygrHZ4Q5/Xei++Jhy3UWrN7afO2ZXjlbNMgp4owu7WIBp97HdFTbHw5l8skUd5O0SysJkmK90VPlIw8f1RTRtWnlnhN/U3ixyhx8XI5wHFZoSUx4Rsa689pDuZ4Dvocr6zEjObySgyawoMrCox+pIeWnY3aKZH0n/NWqhxMOU9RyNN0LbGaJp5LEi5oE8Vg2Z0KyYLl6LebmfaBRJTsjS7pNKIBUFPq/IRiUkr7CEGFxGP24jYo9JUUWNOW1PEcRW7rDV9xuJsAN4Y/Gw32XyYk0h/v1nndygzUcuto89mE80GiOHZ9T+KivC5I8cnjL5x8XUC3hnKOv4vdFNJfaroEb/YHXjEd7L86bCutkRcEDlU+VjKdNF1IM1rFv2cGZosC59f2X9MX6t5fmYb6xBHyA31HWUqTEZrFtKOY777vjHnzwiuRfL2JWN4z+S7CWeUuY6uexLPK1kyaWVOU4O+As5FnkrBDOStwAAAABJRU5ErkJggg==" ,
"PictureFillMode" : "Tile"
}
}
Response
Copy {
"type" : "Picture" ,
"fillFormat" : {
"type" : "Picture" ,
"cropBottom" : 0.0 ,
"cropLeft" : 0.0 ,
"cropRight" : 0.0 ,
"cropTop" : 0.0 ,
"dpi" : 0 ,
"image" : {
"href" : "https://api.aspose.cloud/v3.0/slides/MyPresentation.pptx/images/1?folder=MyFolder" ,
"relation" : "self"
},
"pictureFillMode" : "Tile"
},
"selfUri" : {
"href" : "https://api.aspose.cloud/v3.0/slides/MyPresentation.pptx/slides/2/background?folder=MyFolder" ,
"relation" : "self" ,
"slideIndex" : 2
}
}
SDK Solutions
C#
Copy
using Aspose.Slides.Cloud.Sdk ;
using Aspose.Slides.Cloud.Sdk.Model ;
using System ;
using System.Diagnostics ;
using System.IO ;
class Application
{
static void Main ( )
{
var slidesApi = new SlidesApi ( "MyClientId" , "MyClientSecret" );
var imageData = File . ReadAllBytes ( "MyImage.png" );
var imageBase64String = Convert . ToBase64String ( imageData );
var newBackground = new SlideBackground
{
FillFormat = new PictureFill
{
Base64Data = imageBase64String ,
PictureFillMode = PictureFill . PictureFillModeEnum . Tile
}
};
var currentBackground = slidesApi . SetBackground ( "MyPresentation.pptx" , 2 , newBackground , null , "MyFolder" );
Debug . WriteLine ( currentBackground . Type );
}
}
Java
Copy
import com.aspose.slides.ApiException ;
import com.aspose.slides.api.SlidesApi ;
import com.aspose.slides.model.* ;
import java.io.IOException ;
import java.nio.file.Files ;
import java.nio.file.Paths ;
import java.util.Base64 ;
public class Application {
public static void main ( String [] args ) throws ApiException , IOException {
SlidesApi slidesApi = new SlidesApi ( "MyClientId" , "MyClientSecret" );
byte [] imageData = Files . readAllBytes ( Paths . get ( "MyImage.png" ));
String imageBase64String = new String ( Base64 . getEncoder (). encode ( imageData ));
PictureFill pictureFill = new PictureFill ();
pictureFill . setBase64Data ( imageBase64String );
pictureFill . setPictureFillMode ( PictureFill . PictureFillModeEnum . TILE );
SlideBackground newBackground = new SlideBackground ();
newBackground . setFillFormat ( pictureFill );
SlideBackground currentBackground = slidesApi . setBackground ( "MyPresentation.pptx" , 2 , newBackground , null , "MyFolder" , null );
System . out . println ( currentBackground . getType ());
}
}
PHP
Copy
use Aspose \Slides \Cloud \Sdk \Api \Configuration ;
use Aspose \Slides \Cloud \Sdk \Api \SlidesApi ;
use Aspose \Slides \Cloud \Sdk \Model \PictureFill ;
use Aspose \Slides \Cloud \Sdk \Model \SlideBackground ;
$configuration = new Configuration ();
$configuration -> setAppSid ( "MyClientId" );
$configuration -> setAppKey ( "MyClientSecret" );
$slidesApi = new SlidesApi ( null , $configuration );
$imageData = file_get_contents ( "MyImage.png" );
$imageBase64String = base64_encode ( $imageData );
$pictureFill = new PictureFill ();
$pictureFill -> setBase64Data ( $imageBase64String );
$pictureFill -> setPictureFillMode ( "Tile" );
$newBackground = new SlideBackground ();
$newBackground -> setFillFormat ( $pictureFill );
$currentBackground = $slidesApi -> setBackground ( "MyPresentation.pptx" , 2 , $newBackground , null , "MyFolder" );
echo $currentBackground -> getType ();
Ruby
Copy
require "aspose_slides_cloud"
require "base64"
include AsposeSlidesCloud
configuration = Configuration . new
configuration . app_sid = "MyClientId"
configuration . app_key = "MyClientSecret"
slides_api = SlidesApi . new ( configuration )
image_data = File . binread ( "MyImage.png" )
image_base64_string = Base64 . encode64 ( image_data )
picture_fill = PictureFill . new
picture_fill . base64_data = image_base64_string
picture_fill . picture_fill_mode = "Tile"
new_background = SlideBackground . new
new_background . fill_format = picture_fill
current_background = slides_api . set_background ( "MyPresentation.pptx" , 2 , new_background , nil , "MyFolder" )
print current_background . type
Python
Copy
import asposeslidescloud
import base64
from asposeslidescloud.apis.slides_api import SlidesApi
from asposeslidescloud.models.picture_fill import PictureFill
from asposeslidescloud.models.slide_background import SlideBackground
slides_api = SlidesApi ( None , "MyClientId" , "MyClientSecret" )
with open ( "MyImage.png" , "rb" ) as image_stream :
image_base64_string = str ( base64 . b64encode ( image_stream . read ()), "utf-8" )
picture_fill = PictureFill ()
picture_fill . base64_data = image_base64_string
picture_fill . picture_fill_mode = "Tile"
new_background = SlideBackground ()
new_background . fill_format = picture_fill
current_background = slides_api . set_background ( "MyPresentation.pptx" , 2 , new_background , None , "MyFolder" )
print ( current_background . type )
Node.js
Copy
const cloud = require ( "asposeslidescloud" );
const fs = require ( "fs" );
const slidesApi = new cloud . SlidesApi ( "MyClientId" , "MyClientSecret" );
const imageBase64String = fs . readFileSync ( "MyImage.png" , { encoding : "base64" });
const pictureFill = new cloud . PictureFill ();
pictureFill . base64Data = imageBase64String ;
pictureFill . pictureFillMode = "Tile" ;
const newBackground = new cloud . SlideBackground ();
newBackground . fillFormat = pictureFill ;
slidesApi . setBackground ( "MyPresentation.pptx" , 2 , newBackground , null , "MyFolder" ). then ( currentBackground => {
console . log ( currentBackground . body . type );
});
Android
Copy
import com.aspose.slides.ApiException ;
import com.aspose.slides.api.SlidesApi ;
import com.aspose.slides.model.* ;
import java.io.IOException ;
import java.nio.file.Files ;
import java.nio.file.Paths ;
import java.util.Base64 ;
public class Application {
public static void main ( String [] args ) throws ApiException , IOException {
SlidesApi slidesApi = new SlidesApi ( "MyClientId" , "MyClientSecret" );
byte [] imageData = Files . readAllBytes ( Paths . get ( "MyImage.png" ));
String imageBase64String = new String ( Base64 . getEncoder (). encode ( imageData ));
PictureFill pictureFill = new PictureFill ();
pictureFill . setBase64Data ( imageBase64String );
pictureFill . setPictureFillMode ( PictureFill . PictureFillModeEnum . TILE );
SlideBackground newBackground = new SlideBackground ();
newBackground . setFillFormat ( pictureFill );
SlideBackground currentBackground = slidesApi . setBackground ( "MyPresentation.pptx" , 2 , newBackground , null , "MyFolder" , null );
System . out . println ( currentBackground . getType ());
}
}
C++
Perl
Copy
use AsposeSlidesCloud::Configuration ;
use AsposeSlidesCloud::SlidesApi ;
use AsposeSlidesCloud::Object::PictureFill ;
use AsposeSlidesCloud::Object::SlideBackground ;
use File::Slurp ;
use MIME::Base64 ;
my $config = AsposeSlidesCloud::Configuration -> new ();
$config -> { app_sid } = "MyClientId" ;
$config -> { app_key } = "MyClientSecret" ;
my $slides_api = AsposeSlidesCloud::SlidesApi -> new ( config => $config );
my $image_data = read_file ( "MyImage.png" , { binmode => ":raw" });
my $image_base64_string = encode_base64 ( $image_data );
my $picture_fill = AsposeSlidesCloud::Object::PictureFill -> new ();
$picture_fill -> { base64_data } = $image_base64_string ;
$picture_fill -> { picture_fill_mode } = "Tile" ;
my $new_background = AsposeSlidesCloud::Object::SlideBackground -> new ();
$new_background -> { fill_format } = $picture_fill ;
my %parameters = ( name => "MyPresentation.pptx" , slide_index => 2 , background => $new_background , folder => "MyFolder" );
my $current_background = $slides_api -> set_background ( %parameters );
print $current_background -> { type };
Swift
Go
DeleteBackground
API
Type
Description
Resource
/slides/{name}/slides/{slideIndex}/background
DELETE
Deletes the background applied to a presentation slide.
DeleteBackground
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 delete a background.
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 a background applied to the second slide in MyFolder/MyPresentation.pptx document saved to the default storage.
cURL Solution
SDK Solutions
C#
Copy
using Aspose.Slides.Cloud.Sdk ;
using System.Diagnostics ;
class Application
{
static void Main ( )
{
var slidesApi = new SlidesApi ( "MyClientId" , "MyClientSecret" );
var currentBackground = slidesApi . DeleteBackground ( "MyPresentation.pptx" , 2 , null , "MyFolder" );
Debug . WriteLine ( currentBackground . 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" );
SlideBackground currentBackground = slidesApi . deleteBackground ( "MyPresentation.pptx" , 2 , null , "MyFolder" , null );
System . out . println ( currentBackground . 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 );
$currentBackground = $slidesApi -> deleteBackground ( "MyPresentation.pptx" , 2 , null , "MyFolder" );
echo $currentBackground -> getType ();
Ruby
Copy
require "aspose_slides_cloud"
include AsposeSlidesCloud
configuration = Configuration . new
configuration . app_sid = "MyClientId"
configuration . app_key = "MyClientSecret"
slides_api = SlidesApi . new ( configuration )
current_background = slides_api . delete_background ( "MyPresentation.pptx" , 2 , nil , "MyFolder" )
print current_background . type
Python
Copy
import asposeslidescloud
from asposeslidescloud.apis.slides_api import SlidesApi
slides_api = SlidesApi ( None , "MyClientId" , "MyClientSecret" )
current_background = slides_api . delete_background ( "MyPresentation.pptx" , 2 , None , "MyFolder" )
print ( f "{current_background.type } " )
Node.js
Copy
const cloud = require ( "asposeslidescloud" );
const slidesApi = new cloud . SlidesApi ( "MyClientId" , "MyClientSecret" );
slidesApi . deleteBackground ( "MyPresentation.pptx" , 2 , null , "MyFolder" ). then ( currentBackground => {
console . log ( currentBackground . body . type );
});
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 ( "MyClientId" , "MyClientSecret" );
SlideBackground currentBackground = slidesApi . deleteBackground ( "MyPresentation.pptx" , 2 , null , "MyFolder" , null );
System . out . println ( currentBackground . getType ());
}
}
C++
Copy
#include "asposeslidescloud/api/SlidesApi.h"
using namespace asposeslidescloud :: api ;
int main ()
{
auto slidesApi = new SlidesApi ( L "MyClientId" , L "MyClientSecret" );
auto currentBackground = slidesApi -> deleteBackground ( L "MyPresentation.pptx" , 2 , L "" , L "MyFolder" ). get ();
std :: wcout << currentBackground -> getType ();
std :: cin . get ();
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 );
%parameters = ( name => "MyPresentation.pptx" , slide_index => 2 , folder => "MyFolder" );
my $current_background = $slides_api -> delete_background ( %parameters );
print current_background -> { type };
Swift
Go
SetBackgroundColor
API
Type
Description
Resource
/slides/{name}/slides/{slideIndex}/backgroundColor
PUT
Sets a background color for a presentation slide.
SetBackgroundColor
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.
color
string
query
true
The slide background color in #RRGGBB or #AARRGGBB format.
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
Set the background color to #AABBDD for the first slide in the document MyPresentation.pptx saved in the default storage.
cURL Solution
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 documentName = "MyPresentation.pptx" ;
var slideIndex = 1 ;
var backgroundColor = "#AABBDD" ;
var slideBackground = slidesApi . SetBackgroundColor ( documentName , slideIndex , backgroundColor );
Console . WriteLine ( "Background type: " + slideBackground . FillFormat . Type );
}
}
Java
Copy import com.aspose.slides.ApiException ;
import com.aspose.slides.api.SlidesApi ;
import com.aspose.slides.model.SlideBackground ;
public class Application {
public static void main ( String [] args ) throws ApiException {
SlidesApi slidesApi = new SlidesApi ( "MyClientId" , "MyClientSecret" );
String documentName = "MyPresentation.pptx" ;
int slideIndex = 1 ;
String backgroundColor = "#AABBDD" ;
SlideBackground slideBackground = slidesApi . setBackgroundColor ( documentName , slideIndex , backgroundColor , null , null , null );
System . out . println ( "Background type: " + slideBackground . getFillFormat (). 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 );
$documentName = "MyPresentation.pptx" ;
$slideIndex = 1 ;
$backgroundColor = "#AABBDD" ;
$slideBackground = $slidesApi -> setBackgroundColor ( $documentName , $slideIndex , $backgroundColor );
echo "Background type: " , $slideBackground -> getFillFormat () -> getType ();
Ruby
Copy require "aspose_slides_cloud"
include AsposeSlidesCloud
configuration = Configuration . new
configuration . app_sid = "MyClientId"
configuration . app_key = "MyClientSecret"
slides_api = SlidesApi . new ( configuration )
document_name = "MyPresentation.pptx"
slide_index = 1
background_color = "#AABBDD"
slide_background = slides_api . set_background_color ( document_name , slide_index , background_color )
print "Background type: " , slide_background . fill_format . type
Python
Copy from asposeslidescloud.apis.slides_api import SlidesApi
slides_api = SlidesApi ( None , "MyClientId" , "MyClientSecret" )
document_name = "MyPresentation.pptx"
slide_index = 1
background_color = "#AABBDD"
slide_background = slides_api . set_background_color ( document_name , slide_index , background_color )
print ( "Background type:" , slide_background . fill_format . type )
Node.js
Copy const cloud = require ( "asposeslidescloud" );
const slidesApi = new cloud . SlidesApi ( "MyClientId" , "MyClientSecret" );
const documentName = "MyPresentation.pptx" ;
const slideIndex = 1 ;
const backgroundColor = "#AABBDD" ;
slidesApi . setBackgroundColor ( documentName , slideIndex , backgroundColor ). then ( slideBackground => {
console . log ( "Background type:" , slideBackground . body . fillFormat . 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 documentName = L "MyPresentation.pptx" ;
auto slideIndex = 1 ;
auto backgroundColor = L "#AABBDD" ;
auto slideBackground = slidesApi -> setBackgroundColor ( documentName , slideIndex , backgroundColor ). get ();
std :: wcout << "Background type: " << slideBackground -> getFillFormat () -> getType ();
}
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 , color => "#AABBDD" );
my $slide_background = $slides_api -> set_background_color ( %parameters );
print ( "Background type: " . $slide_background -> { type });
Swift
Go
SDKs
Check Available SDKs to learn how to add an SDK to your project.