### Create Pie Chart in Python
Source: https://docs.aspose.cloud/slides/create-a-pie-chart
This Python example shows the setup and usage for creating a pie chart with Aspose.Slides Cloud SDK. Ensure the SDK is installed and credentials are set.
```python
import asposeslidescloud
from asposeslidescloud.configuration import Configuration
from asposeslidescloud.apis.slides_api import SlidesApi
from asposeslidescloud.models.chart import Chart
from asposeslidescloud.models.chart_title import ChartTitle
from asposeslidescloud.models.chart_category import ChartCategory
from asposeslidescloud.models.one_value_series import OneValueSeries
from asposeslidescloud.models.one_value_chart_data_point import OneValueChartDataPoint
configuration = Configuration()
configuration.app_sid = 'MyClientId'
configuration.app_key = 'MyClientSecret'
api = SlidesApi(configuration)
dto = Chart()
dto.chart_type = 'Pie'
dto.x = 100
dto.y = 100
dto.width = 400
dto.height = 400
title = ChartTitle()
title.text = 'Pie Chart'
dto.title = title
category1 = ChartCategory()
category1.value = 'First'
category2 = ChartCategory()
category2.value = 'Second'
category3 = ChartCategory()
```
--------------------------------
### Get All Text Items (Go)
Source: https://docs.aspose.cloud/slides/read-text-items
This Go example demonstrates how to fetch all text items from a presentation. Ensure the API client is configured with your credentials.
```go
// For complete examples and data files, please go to https://github.com/aspose-slides-cloud/Aspose.Slides-Cloud-SDK-for-Go
cfg := asposeslidescloud.NewConfiguration()
cfg.AppSid = "MyClientId"
cfg.AppKey = "MyClientSecret"
api := asposeslidescloud.NewAPIClient(cfg)
var withEmpty bool = true
// Get all text items from the presentation.
textItems, _, e := api.SlidesApi.GetPresentationTextItems("MyPresentation.pptx", &withEmpty, "", "MyFolder", "")
if e != nil {
fmt.Printf("Error: %v.", e)
return
}
// Print the number of the text items.
fmt.Printf("Found %v items.", len(textItems.GetItems()))
```
--------------------------------
### Create Presentation in Python
Source: https://docs.aspose.cloud/slides/create-a-new-presentation
This Python example demonstrates creating a presentation using the SlidesApi.create_presentation method. Ensure the asposeslidescloud library is installed and configured with your credentials.
```python
# For complete examples and data files, please go to https://github.com/aspose-slides-cloud/Aspose.Slides-Cloud-SDK-for-Python
import asposeslidescloud
from asposeslidescloud.apis.slides_api import SlidesApi
slides_api = SlidesApi(None, "my_client_id", "my_client_key")
response = slides_api.create_presentation("Sales.pptx", None, None, None, "Data", "Main")
print(response.self_uri.href) # https://api.aspose.cloud/v3.0/slides/Sales.pptx?folder=Data
```
--------------------------------
### Initialize Configuration in Go
Source: https://docs.aspose.cloud/slides/replace-text-without-using-a-storage
Set up the Aspose Slides Cloud configuration in Go by providing your client ID and secret.
```go
cfg := asposeslidescloud.NewConfiguration()
cfg.AppSid = "MyClientId"
cfg.AppKey = "MyClientSecret"
```
--------------------------------
### Get Table Cell Paragraphs (Ruby)
Source: https://docs.aspose.cloud/slides/get-paragraphs-from-a-table-cell
This Ruby example shows how to get paragraph data from a presentation table cell using the Aspose.Slides Cloud SDK. It covers API setup and the call to retrieve paragraphs.
```Ruby
require "aspose_slides_cloud"
include AsposeSlidesCloud
configuration = Configuration.new
configuration.app_sid = "MyClientId"
configuration.app_key = "MyClientSecret"
slides_api = SlidesApi.new(configuration)
file_name = "MyPresentation.pptx"
slide_index = 9
shape_index = 1
row_index = 2
cell_index = 2
paragraphs = slides_api.get_table_cell_paragraphs(file_name, slide_index, shape_index, row_index, cell_index)
paragraph_count = paragraphs.paragraph_links.length
puts "Number of paragraphs: #{paragraph_count}" # 3
```
--------------------------------
### Get Text Portion Properties in Go
Source: https://docs.aspose.cloud/slides/get-text-portion-properties
This Go example demonstrates fetching font properties of a text portion. Ensure you have the Aspose.Slides Cloud SDK for Go installed and configured.
```go
import (
"fmt"
asposeslidescloud "github.com/aspose-slides-cloud/Aspose.Slides-Cloud-SDK-for-Go/v24"
)
func main() {
configuration := asposeslidescloud.NewConfiguration()
configuration.AppSid = "MyClientId"
configuration.AppKey = "MyClientSecret"
slidesApi := asposeslidescloud.NewAPIClient(configuration).SlidesApi
fileName := "MyPresentation.pptx"
var slideIndex int32 = 1
var shapeIndex int32 = 2
var paragraphIndex int32 = 3
var portionIndex int32 = 2
portion, _, _ := slidesApi.GetPortion(fileName, slideIndex, paragraphIndex, portionIndex, shapeIndex, "", "", "", "")
fmt.Println("Font name:", portion.GetLatinFont()) // Arial
fmt.Println("Font height:", portion.GetFontHeight()) // 20
fmt.Println("Italic font:", portion.GetFontItalic()) // True
fmt.Println("Font color:", portion.GetFontColor()) // #FF4472C4
}
```
--------------------------------
### Run Self-Hosted Solution with Authorization
Source: https://docs.aspose.cloud/slides/authorizing-requests-to-self-hosted-solution
Start the Aspose.Slides container with authorization enabled by setting ClientId and ClientSecret as environment variables. Mount a volume for storage.
```bash
docker run -p 8088:80 -e "LicensePublicKey=public_key" -e "LicensePrivateKey=private_key"\
-e "ClientId=MyClientId" -e "ClientSecret=MyClientSecret"\
-v "/data:/storage" aspose/slides-cloud
```
--------------------------------
### Ruby SDK Setup
Source: https://docs.aspose.cloud/slides/add-a-shape-to-a-group-shape
Initializes the Aspose.Slides Cloud SDK for Ruby with application credentials. This setup is required before making any API calls.
```ruby
# For complete examples and data files, please go to https://github.com/aspose-slides-cloud/Aspose.Slides-Cloud-SDK-for-Ruby
require "aspose_slides_cloud"
include AsposeSlidesCloud
configuration = AsposeSlidesCloud::Configuration.new
configuration.app_sid = "MyClientId"
configuration.app_key = "MyClientSecret"
slides_api = AsposeSlidesCloud::SlidesApi.new(configuration)
```
--------------------------------
### Read Layout Slide Information using Python SDK
Source: https://docs.aspose.cloud/slides/read-information-about-a-layout-slide
Use the Aspose.Slides Cloud SDK for Python to get information about the second layout slide from a presentation. This example requires the SDK to be installed.
```Python
# For complete examples and data files, please go to https://github.com/aspose-slides-cloud/Aspose.Slides-Cloud-SDK-for-Python
import asposeslidescloud
from asposeslidescloud.apis.slides_api import SlidesApi
slides_api = SlidesApi(None, "MyClientId", "MyClientSecret")
# Read information of the second layout slide.
layout_slide = slides_api.get_layout_slide("MyPresentation.pptx", 2, None, "MyFolder")
```
--------------------------------
### Create Presentation from Template (Python)
Source: https://docs.aspose.cloud/slides/use-a-document-template
This Python example demonstrates creating a presentation from a template. Remember to replace the placeholder credentials with your own.
```python
# For complete examples and data files, please go to https://github.com/aspose-slides-cloud/Aspose.Slides-Cloud-SDK-for-Python
import asposeslidescloud
from asposeslidescloud.apis.slides_api import SlidesApi
slides_api = SlidesApi(None, "my_client_id", "my_client_key")
data = """
John Doe
10 Downing Street
London
+457 123456
Hi, I'm John and this is my CV
C#
Excellent
Cpp
Good
Java
Average
"
response = slides_api.create_presentation_from_template(
"JohnDoeCV.pptx", "Resources/TemplateCV.pptx", data, None, "Main", None, None, "Data", "Main")
print(response.self_uri.href) # https://api.aspose.cloud/v3.0/slides/JohnDoeCV.pptx?folder=Data
```
--------------------------------
### Get Text Items using C# SDK
Source: https://docs.aspose.cloud/slides/read-text-items
This C# example demonstrates how to use the Aspose.Slides Cloud SDK to retrieve all text items from a presentation. Ensure you have the SDK installed and configured with your client ID and secret.
```csharp
Copy// For complete examples and data files, please go to https://github.com/aspose-slides-cloud/Aspose.Slides-Cloud-SDK-for-.NET
using Aspose.Slides.Cloud.Sdk;
using System.Diagnostics;
class Application
{
static void Main()
{
var slidesApi = new SlidesApi("MyClientId", "MyClientSecret");
// Get all text items from the presentation.
var textItems = slidesApi.GetPresentationTextItems("MyPresentation.pptx", true, null, "MyFolder");
// Print the texts.
foreach (var textItem in textItems.Items)
{
Debug.WriteLine(textItem.Text);
}
}
}
```
--------------------------------
### Convert Presentation to PDF (Go)
Source: https://docs.aspose.cloud/slides/convert-selected-slides
Shows how to convert a PPTX presentation to PDF using the Go SDK. This example reads the file, calls the conversion API, and prints the result name.
```go
// For complete examples and data files, please go to https://github.com/aspose-slides-cloud/Aspose.Slides-Cloud-SDK-for-Go
cfg := asposeslidescloud.NewConfiguration()
cfg.AppSid = "my_client_id"
cfg.AppKey = "my_client_key"
api := asposeslidescloud.NewAPIClient(cfg)
source, e := ioutil.ReadFile("MyPresentation.pptx")
if e != nil {
fmt.Printf("Error: %v.", e)
return
}
result, _, e := api.SlidesApi.Convert(source, "pdf", "", "", "", []int32 { 2, 4 }, nil)
if e != nil {
fmt.Printf("Error: %v.", e)
return
}
fmt.Printf("The converted file was saved to %v.", result.Name())
```
--------------------------------
### Upload Presentation and Get Paragraph Properties (Android)
Source: https://docs.aspose.cloud/slides/read-paragraph-properties
Shows how to upload a presentation to storage and retrieve paragraph properties like text alignment and spacing. This example requires the Aspose.Slides Cloud SDK for Java and proper setup of credentials.
```java
// For complete examples and data files, please go to https://github.com/aspose-slides-cloud/Aspose.Slides-Cloud-SDK-for-Java
import com.aspose.slides.api.SlidesApi;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class Main {
public static void main(String[] args) {
SlidesApi slidesApi = new SlidesApi("my_client_id", "my_client_key");
String fileName = "example.pptx";
String storageName = "Main";
String folderName = "Data";
int slideIndex = 1;
int shapeIndex = 2;
int paragraphIndex = 1;
String password = "";
try {
// The path to the presentation file in the storage.
String filePath = Paths.get(folderName, fileName).toString().replace('\\', '/');
// Upload the presentation to the storage.
byte[] fileData = Files.readAllBytes(new File(fileName).toPath());
slidesApi.uploadFile(filePath, fileData, storageName);
// Get properties of the specified paragraph.
Paragraph paragraph = slidesApi.getParagraph(
fileName, slideIndex, shapeIndex, paragraphIndex, password, folderName, storageName);
// Display some paragraph properties.
System.out.println("Text alignment: " + paragraph.getAlignment());
System.out.println("Spacing before: " + paragraph.getSpaceBefore());
} catch (Exception e) {
e.printStackTrace();
}
}
}
```
--------------------------------
### Initialize SlidesApi in Ruby
Source: https://docs.aspose.cloud/slides/add-a-smartart-graphic-to-a-slide
This Ruby snippet shows the initial setup for using the Aspose.Slides Cloud SDK. It demonstrates how to configure the API with client credentials.
```ruby
# For complete examples and data files, please go to https://github.com/aspose-slides-cloud/Aspose.Slides-Cloud-SDK-for-Ruby
require "aspose_slides_cloud"
include AsposeSlidesCloud
configuration = AsposeSlidesCloud::Configuration.new
configuration.app_sid = "MyClientId"
configuration.app_key = "MyClientSecret"
slides_api = AsposeSlidesCloud::SlidesApi.new(configuration)
```
--------------------------------
### Get Protection Properties (Perl SDK)
Source: https://docs.aspose.cloud/slides/read-protection-properties
Example of how to get protection properties using the Aspose.Slides Cloud SDK for Perl.
```APIDOC
## get_protection_properties(name => $name)
### Description
Retrieves the protection properties of a presentation file using the Perl SDK.
### Method Signature
`SlidesApi->get_protection_properties(%parameters)`
### Parameters
#### Path Parameters
- **name** (string) - Required - The name of the presentation file.
### Request Example
```perl
use AsposeSlidesCloud::Configuration;
use AsposeSlidesCloud::SlidesApi;
my $config = AsposeSlidesCloud::Configuration->new();
$config->{app_sid} = "MyClientId";
$config->{app_key} = "MyClientSecret";
my $api = AsposeSlidesCloud::SlidesApi->new(config => $config);
my %parameters = (name => "MyPresentation.pptx");
my $response = $api->get_protection_properties(%parameters);
if ($response->{is_encrypted}) {
print("The presentation is protected.");
}
```
```
--------------------------------
### Get Protection Properties (Go SDK)
Source: https://docs.aspose.cloud/slides/read-protection-properties
Example of how to get protection properties using the Aspose.Slides Cloud SDK for Go.
```APIDOC
## GetProtectionProperties(string name, string password, string folder, string storage)
### Description
Retrieves the protection properties of a presentation file using the Go SDK.
### Method Signature
`api.SlidesApi.GetProtectionProperties(string name, string password, string folder, string storage)`
### Parameters
#### Path Parameters
- **name** (string) - Required - The name of the presentation file.
- **password** (string) - Optional - The password for encrypted files.
- **folder** (string) - Optional - The folder containing the file.
- **storage** (string) - Optional - The storage name.
### Request Example
```go
cfg := asposeslidescloud.NewConfiguration()
cfg.AppSid = "MyClientId"
cfg.AppKey = "MyClientSecret"
api := asposeslidescloud.NewAPIClient(cfg)
response, _, e := api.SlidesApi.GetProtectionProperties("MyPresentation.pptx", "", "", "")
if e != nil {
fmt.Printf("Error: %v.", e)
return
}
if response.GetIsEncrypted() {
fmt.Printf("The presentation is protected.")
}
```
```
--------------------------------
### Get Protection Properties (Node.js SDK)
Source: https://docs.aspose.cloud/slides/read-protection-properties
Example of how to get protection properties using the Aspose.Slides Cloud SDK for Node.js.
```APIDOC
## getProtectionProperties(name)
### Description
Retrieves the protection properties of a presentation file using the Node.js SDK.
### Method Signature
`api.getProtectionProperties(name)`
### Parameters
#### Path Parameters
- **name** (string) - Required - The name of the presentation file.
### Request Example
```javascript
const CloudSdk = require("asposeslidescloud");
const api = new CloudSdk.SlidesApi("MyClientId", "MyClientSecret");
const response = await api.getProtectionProperties("MyPresentation.pptx");
if (response.body.isEncrypted)
console.log("The presentation is protected.");
```
```
--------------------------------
### Create Chart with Data Source - Go
Source: https://docs.aspose.cloud/slides/set-a-chart-data-source
This Go example demonstrates creating a chart with data linked to workbook sources. It requires initializing the Aspose.Slides Cloud SDK client with your credentials.
```go
config := asposeslidescloud.NewConfiguration()
config.AppSid = "MyClientId"
config.AppKey = "MyClientSecret"
api := asposeslidescloud.NewAPIClient(config).SlidesApi
fileName := "MyPresentation.pptx"
var slideIndex int32 = 1
chart := asposeslidescloud.NewChart()
chart.ChartType = "ClusteredColumn"
chart.X = 20
chart.Y = 20
chart.Width = 400
chart.Height = 300
dataSourceForCategories := asposeslidescloud.NewWorkbook()
dataSourceForCategories.WorksheetIndex = 1
dataSourceForCategories.ColumnIndex = 1
dataSourceForCategories.RowIndex = 2
chart.DataSourceForCategories = dataSourceForCategories
category1 := asposeslidescloud.NewChartCategory()
category1.Value = "Category1"
category2 := asposeslidescloud.NewChartCategory()
category2.Value = "Category2"
category3 := asposeslidescloud.NewChartCategory()
category3.Value = "Category3"
chart.Categories = []asposeslidescloud.IChartCategory{category1, category2, category3}
series1 := asposeslidescloud.NewOneValueSeries()
series1.Name = "Series1"
dataSourceForSeries1Name := asposeslidescloud.NewWorkbook()
dataSourceForSeries1Name.WorksheetIndex = 1
dataSourceForSeries1Name.ColumnIndex = 2
dataSourceForSeries1Name.RowIndex = 1
series1.DataSourceForSeriesName = dataSourceForSeries1Name
dataSourceForSeries1Values := asposeslideslidescloud.NewWorkbook()
dataSourceForSeries1Values.WorksheetIndex = 1
dataSourceForSeries1Values.ColumnIndex = 2
dataSourceForSeries1Values.RowIndex = 2
series1.DataSourceForValues = dataSourceForSeries1Values
point11 := asposeslidescloud.NewOneValueChartDataPoint()
point11.Value = 40
point12 := asposeslidescloud.NewOneValueChartDataPoint()
point12.Value = 50
point13 := asposeslidescloud.NewOneValueChartDataPoint()
point13.Value = 70
series1.DataPoints = []asposeslidescloud.IOneValueChartDataPoint{point11, point12, point13}
series2 := asposeslidescloud.NewOneValueSeries()
series2.Name = "Series2"
dataSourceForSeries2Name := asposeslidescloud.NewWorkbook()
dataSourceForSeries2Name.WorksheetIndex = 1
dataSourceForSeries2Name.ColumnIndex = 3
dataSourceForSeries2Name.RowIndex = 1
series2.DataSourceForSeriesName = dataSourceForSeries2Name
dataSourceForSeries2Values := asposeslidescloud.NewWorkbook()
dataSourceForSeries2Values.WorksheetIndex = 1
dataSourceForSeries2Values.ColumnIndex = 3
dataSourceForSeries2Values.RowIndex = 2
series2.DataSourceForValues = dataSourceForSeries2Values
point21 := asposeslidescloud.NewOneValueChartDataPoint()
point21.Value = 55
point22 := asposeslidescloud.NewOneValueChartDataPoint()
point22.Value = 35
point23 := asposeslidescloud.NewOneValueChartDataPoint()
point23.Value = 90
series2.DataPoints = []asposeslidescloud.IOneValueChartDataPoint{point21, point22, point23}
chart.Series = []asposeslidescloud.ISeries{series1, series2}
api.CreateShape(fileName, slideIndex, chart, nil, nil, "", "", "", "")
fmt.Printf("Chart has been created.")
```
--------------------------------
### Get Protection Properties (Python SDK)
Source: https://docs.aspose.cloud/slides/read-protection-properties
Example of how to get protection properties using the Aspose.Slides Cloud SDK for Python.
```APIDOC
## get_protection_properties(name)
### Description
Retrieves the protection properties of a presentation file using the Python SDK.
### Method Signature
`SlidesApi.get_protection_properties(name)`
### Parameters
#### Path Parameters
- **name** (str) - Required - The name of the presentation file.
### Request Example
```python
import asposeslidescloud
from asposeslidescloud.configuration import Configuration
from asposeslidescloud.apis.slides_api import SlidesApi
configuration = Configuration()
configuration.app_sid = "MyClientId"
configuration.app_key = "MyClientSecret"
api = SlidesApi(configuration)
response = api.get_protection_properties("MyPresentation.pptx")
if response.is_encrypted:
print("The presentation is protected.")
```
```
--------------------------------
### Initialize Slides API in Ruby
Source: https://docs.aspose.cloud/slides/replace-text-with-formatting
Sets up the configuration for the Aspose.Slides Cloud SDK in Ruby. This includes providing the application credentials.
```ruby
# For complete examples and data files, please go to https://github.com/aspose-slides-cloud/Aspose.Slides-Cloud-SDK-for-Ruby
require "aspose_slides_cloud"
include AsposeSlidesCloud
configuration = Configuration.new
configuration.app_sid = "MyClientId"
configuration.app_key = "MyClientSecret"
slides_api = AsposeSlidesCloud::SlidesApi.new(configuration)
```
--------------------------------
### Get Protection Properties (Ruby SDK)
Source: https://docs.aspose.cloud/slides/read-protection-properties
Example of how to get protection properties using the Aspose.Slides Cloud SDK for Ruby.
```APIDOC
## get_protection_properties(String name)
### Description
Retrieves the protection properties of a presentation file using the Ruby SDK.
### Method Signature
`SlidesApi.get_protection_properties(String name)`
### Parameters
#### Path Parameters
- **name** (String) - Required - The name of the presentation file.
### Request Example
```ruby
require "aspose_slides_cloud"
include AsposeSlidesCloud
configuration = Configuration.new
configuration.app_sid = "MyClientId"
configuration.app_key = "MyClientSecret"
api = SlidesApi.new(configuration)
response = api.get_protection_properties("MyPresentation.pptx")
if response.is_encrypted
puts "The presentation is protected."
end
```
```
--------------------------------
### Get Protection Properties (PHP SDK)
Source: https://docs.aspose.cloud/slides/read-protection-properties
Example of how to get protection properties using the Aspose.Slides Cloud SDK for PHP.
```APIDOC
## getProtectionProperties(string $name)
### Description
Retrieves the protection properties of a presentation file using the PHP SDK.
### Method Signature
`SlidesApi->getProtectionProperties(string $name)`
### Parameters
#### Path Parameters
- **name** (string) - Required - The name of the presentation file.
### Request Example
```php
use Aspose\Slides\Cloud\Sdk\Api\Configuration;
use Aspose\Slides\Cloud\Sdk\Api\SlidesApi;
$config = new Configuration();
$config->setAppSid("MyClientId");
$config->setAppKey("MyClientSecret");
$api = new SlidesApi(null, $config);
$response = $api->getProtectionProperties("MyPresentation.pptx");
if ($response->getIsEncrypted())
print("The presentation is protected.");
```
```
--------------------------------
### Convert Presentation to PDF with .NET SDK (Self-Hosted with Auth)
Source: https://docs.aspose.cloud/slides/using-sdks-with-self-hosted-solution
This example shows how to convert a presentation to PDF using the self-hosted Slides Cloud solution with authentication. Provide your ClientId and ClientSecret along with the base URL.
```.NET
Configuration config = new Configuration();
config.ApiBaseUrl = "http://localhost:8088";
config.ClientId = "MyClientId";
config.ClientSecret = "MyClientSecret";
SlidesApi api = new SlidesApi(config);
... // My API requests
```
--------------------------------
### Initialize Slides API in Perl
Source: https://docs.aspose.cloud/slides/add-a-smartart-graphic-to-a-slide
Sets up the Aspose.Slides Cloud configuration with client ID and secret for API access.
```perl
# For complete examples and data files, please go to https://github.com/aspose-slides-cloud/Aspose.Slides-Cloud-SDK-for-Perl
use AsposeSlidesCloud::Configuration;
use AsposeSlidesCloud::SlidesApi;
use AsposeSlidesCloud::Object::SmartArt;
use AsposeSlidesCloud::Object::SmartArtNode;
my $config = AsposeSlidesCloud::Configuration->new();
$config->{app_sid} = "MyClientId";
$config->{app_key} = "MyClientSecret";
my $slides_api = AsposeSlidesCloud::SlidesApi->new(config => $config);
```
--------------------------------
### Get Protection Properties (Java SDK)
Source: https://docs.aspose.cloud/slides/read-protection-properties
Example of how to get protection properties using the Aspose.Slides Cloud SDK for Java.
```APIDOC
## getProtectionProperties(String name, String password, String folder, String storage)
### Description
Retrieves the protection properties of a presentation file using the Java SDK.
### Method Signature
`SlidesApi.getProtectionProperties(String name, String password, String folder, String storage)`
### Parameters
#### Path Parameters
- **name** (String) - Required - The name of the presentation file.
- **password** (String) - Optional - The password for encrypted files.
- **folder** (String) - Optional - The folder containing the file.
- **storage** (String) - Optional - The storage name.
### Request Example
```java
SlidesApi api = new SlidesApi("MyClientId", "MyClientSecret");
ProtectionProperties protectionProperties = api.getProtectionProperties("MyPresentation.pptx", null, null, null);
if (protectionProperties.getIsEncrypted())
System.out.println("The presentation is protected.");
```
```
--------------------------------
### Initialize Slides API using PHP SDK
Source: https://docs.aspose.cloud/slides/get-paragraph-effective-values
Set up the Aspose.Slides Cloud SDK for PHP by configuring your application credentials. Instantiate the SlidesApi with your application SID and key.
```php
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);
$fileName = "MyPresentation.pptx";
$slideIndex = 1;
$shapeIndex = 1;
```
--------------------------------
### Get Protection Properties (C# SDK)
Source: https://docs.aspose.cloud/slides/read-protection-properties
Example of how to get protection properties using the Aspose.Slides Cloud SDK for C#.
```APIDOC
## GetProtectionProperties(string name)
### Description
Retrieves the protection properties of a presentation file using the C# SDK.
### Method Signature
`SlidesApi.GetProtectionProperties(string name)`
### Parameters
#### Path Parameters
- **name** (string) - Required - The name of the presentation file.
### Request Example
```csharp
SlidesApi api = new SlidesApi("MyClientId", "MyClientSecret");
ProtectionProperties protectionProperties = api.GetProtectionProperties("MyPresentation.pptx");
if (protectionProperties.IsEncrypted.Value)
Console.WriteLine("The presentation is protected.");
```
```
--------------------------------
### Get Presentation Fonts (Go SDK)
Source: https://docs.aspose.cloud/slides/get-presentation-fonts
Example of how to use the Aspose.Slides Cloud SDK for Go to get font information from a presentation.
```APIDOC
## GetFontsOnline (Go)
### Description
Gets font information from a presentation file using the Go SDK.
### Method Signature
`GetFontsOnline(document []byte, password string)`
### Parameters
#### Path Parameters
None
#### Query Parameters
- **password** (string) - Optional - The password for encrypted presentations.
#### Request Body
- **document** ([]byte) - Required - The presentation file content as a byte slice.
### Request Example
```go
cfg := asposeslidescloud.NewConfiguration()
cfg.AppSid = "MyClientId"
cfg.AppKey = "MyClientSecret"
api := asposeslidescloud.NewAPIClient(cfg)
document, e := ioutil.ReadFile("MyPresentation.pptx")
response, _, e := api.SlidesApi.GetFontsOnline(document, "")
if e != nil {
fmt.Printf("Error: %v.", e)
return
}
fmt.Printf("Count of fonts used in the presentation: %v", len(response.GetList()))
```
### Response
#### Success Response (200)
Returns a FontsData object containing the list of fonts used in the presentation.
```
--------------------------------
### Compress Image using Go SDK
Source: https://docs.aspose.cloud/slides/compress-an-image
Compress an image in a presentation using the Go SDK. This example initializes the SDK configuration and makes a call to the CompressImage method, handling potential errors.
```go
cfg := asposeslidescloud.NewConfiguration()
cfg.AppSid = "MyClientId"
cfg.AppKey = "MyClientSecret"
api := asposeslidescloud.NewAPIClient(cfg)
fileName := "MyPresentation.pptx"
var slideIndex int32 = 2
var shapeIndex int32 = 4
var resolution float64 = 150
_, e := api.SlidesApi.CompressImage(fileName, slideIndex, shapeIndex, &resolution, nil, "", "", "")
if e != nil {
fmt.Printf("Error: %v.", e)
}
```
--------------------------------
### Get Presentation Fonts (Node.js SDK)
Source: https://docs.aspose.cloud/slides/get-presentation-fonts
Example of how to use the Aspose.Slides Cloud SDK for Node.js to get font information from a presentation.
```APIDOC
## getFontsOnline (Node.js)
### Description
Gets font information from a presentation file using the Node.js SDK.
### Method Signature
`getFontsOnline(stream)`
### Parameters
#### Path Parameters
None
#### Query Parameters
None
#### Request Body
- **stream** (ReadableStream) - Required - A readable stream of the presentation file.
### Request Example
```javascript
const CloudSdk = require("asposeslidescloud");
const fs = require("fs");
const api = new CloudSdk.SlidesApi("MyClientId", "MyClientSecret");
const stream = fs.createReadStream("MyPresentation.pptx");
let response = await api.getFontsOnline(stream);
console.log("Count of fonts used in the presentation: " + response.body.list.length);
```
### Response
#### Success Response (200)
Returns the response body containing the list of fonts used in the presentation.
```
--------------------------------
### Split Presentation to BMP Images (C++)
Source: https://docs.aspose.cloud/slides/split-a-presentation-from-a-local-file-and-save-parts-to-storage
This C++ example demonstrates splitting a presentation into BMP images and saving them to cloud storage. It prepares the request with the presentation file and output parameters, then processes the response.
```cpp
// For complete examples and data files, please go to https://github.com/aspose-slides-cloud/Aspose.Slides-Cloud-SDK-for-Cpp
#include "asposeslidescloud/api/SlidesApi.h"
using namespace utility;
using namespace utility::conversions;
using namespace asposeslidescloud::api;
int main()
{
auto slidesApi = std::make_shared(to_string_t("my_client_id"), to_string_t("my_client_secret"));
// Prepare a request content for the splitting.
auto presentationStream = std::make_shared("MyPresentation.pptx", std::ios::binary);
auto requestContent = std::make_shared();
requestContent->setData(presentationStream);
// Split the first three slides and save them to 480x270 bitmaps in the storage.
auto responseContent = slidesApi->splitAndSaveOnline(
requestContent, to_string_t("bmp"), to_string_t("MyImages"), 480, 270, 1, 3, string_t(), to_string_t("MyStorage")).get();
// Print information about the result.
for (auto slide : responseContent->getSlides())
{
// Output: https://api.aspose.cloud/v3.0/slides/storage/file/MyImages/sourcePresentation_1.bmp, etc.
std::cout << to_utf8string(slide->getHref()) << std::endl;
}
return 0;
}
```
--------------------------------
### Get Presentation Fonts (Python SDK)
Source: https://docs.aspose.cloud/slides/get-presentation-fonts
Example of how to use the Aspose.Slides Cloud SDK for Python to get font information from a presentation.
```APIDOC
## get_fonts_online (Python)
### Description
Gets font information from a presentation file using the Python SDK.
### Method Signature
`get_fonts_online(source)`
### Parameters
#### Path Parameters
None
#### Query Parameters
None
#### Request Body
- **source** (bytes) - Required - The presentation file content as bytes.
### Request Example
```python
import asposeslidescloud
from asposeslidescloud.configuration import Configuration
from asposeslidescloud.apis.slides_api import SlidesApi
configuration = Configuration()
configuration.app_sid = 'MyClientId'
configuration.app_key = 'MyClientSecret'
api = SlidesApi(configuration)
with open("MyPresentation.pptx", 'rb') as f:
source = f.read()
response = api.get_fonts_online(source)
print(f"Count of fonts used in the presentation: { len(response.list) }")
```
### Response
#### Success Response (200)
Returns a FontsData object containing the list of fonts used in the presentation.
```
--------------------------------
### Track Split Operation Progress in Go
Source: https://docs.aspose.cloud/slides/track-split-progress
This Go example demonstrates starting a merge operation (note: example uses startMerge, but description implies split) and then polling for its status. It includes error handling and prints the operation's status and progress. Ensure Aspose.Slides Cloud SDK for Go is set up.
```go
// For complete examples and data files, please go to https://github.com/aspose-slides-cloud/Aspose.Slides-Cloud-SDK-for-Go
cfg := asposeslidescloud.NewConfiguration()
cfg.AppSid = "my_client_id"
cfg.AppKey = "my_client_key"
api := asposeslidescloud.NewAPIClient(cfg)
operationId, _, e := api.SlidesAsyncApi.StartMerge("MyPresentation.pptx", "png", nil, nil, nil, nil, nil, "splitResult", "", "", "", "")
if e != nil {
fmt.Printf("Error: %v.", e)
return
}
var operation asposeslidescloud.IOperation
for {
time.Sleep(time.Duration(2) * time.Second)
operation, _, e = api.SlidesAsyncApi.GetOperationStatus(operationId)
if e != nil {
fmt.Printf("Error: %v.", e)
return
}
fmt.Printf("Current operation status: %v.", operation.GetStatus())
if operation.GetStatus() != "Started" {
if operation.GetProgress() != nil {
fmt.Printf("Operation is in progress. Processed %v slides of %v.", operation.GetProgress().GetStepIndex(), operation.GetProgress().GetStepCount())
}
continue
}
if operation.GetStatus() != "Canceled" {
fmt.Printf("Operation canceled.")
break
}
if operation.GetStatus() != "Failed" {
fmt.Printf("Error: %v.", operation.GetError())
break
}
if operation.GetStatus() != "Finished" {
fmt.Printf("Operation complete.")
break
}
}
```
--------------------------------
### Create Zoom Frame in Go
Source: https://docs.aspose.cloud/slides/working-with-zoom-frames
This Go example demonstrates creating a Zoom Frame in a presentation. Initialize the API client with your configuration and handle potential errors.
```go
cfg := asposeslidescloud.NewConfiguration()
cfg.AppSid = "MyClientId"
cfg.AppKey = "MyClientSecret"
api := asposeslidescloud.NewAPIClient(cfg)
fileName := "MyPresentation.pptx"
var slideIndex int32 = 3
dto := asposeslidescloud.NewZoomFrame()
dto.X = 0
dto.Y = 0
dto.Width = 200
dto.Height = 100
dto.TargetSlideIndex = 2
shape, _, e := api.SlidesApi.CreateShape(fileName, slideIndex, dto, nil, nil, "", "", "", "")
if e != nil {
fmt.Printf("Error: %v.", e)
}
if shape == nil {
fmt.Printf("Error: shape should not be nil.")
}
```
--------------------------------
### Get Presentation Fonts (PHP SDK)
Source: https://docs.aspose.cloud/slides/get-presentation-fonts
Example of how to use the Aspose.Slides Cloud SDK for PHP to get font information from a presentation.
```APIDOC
## getFontsOnline (PHP)
### Description
Gets font information from a presentation file using the PHP SDK.
### Method Signature
`getFontsOnline($file)`
### Parameters
#### Path Parameters
None
#### Query Parameters
None
#### Request Body
- **file** (resource) - Required - The presentation file to analyze (opened stream resource).
### Request Example
```php
use Aspose\Slides\Cloud\Sdk\Configuration;
use Aspose\Slides\Cloud\Sdk\Api\SlidesApi;
use Aspose\Slides\Cloud\Sdk\Model\FontsData;
$config = new Configuration();
$config->setAppSid("MyClientId");
$config->setAppKey("MyClientSecret");
$api = new SlidesApi(null, $config);
$file = fopen("MyPresentation.pptx", 'r');
$result = $api->getFontsOnline($file);
print("Count of fonts used in the presentation: " . count($result->getList()));
```
### Response
#### Success Response (200)
Returns a FontsData object containing the list of fonts used in the presentation.
```
--------------------------------
### Get Presentation Fonts (Java SDK)
Source: https://docs.aspose.cloud/slides/get-presentation-fonts
Example of how to use the Aspose.Slides Cloud SDK for Java to get font information from a presentation.
```APIDOC
## getFontsOnline (Java)
### Description
Gets font information from a presentation file using the Java SDK.
### Method Signature
`FontsData getFontsOnline(byte[] file, String password)`
### Parameters
#### Path Parameters
None
#### Query Parameters
- **password** (String) - Optional - The password for encrypted presentations.
#### Request Body
- **file** (byte[]) - Required - The presentation file to analyze.
### Request Example
```java
SlidesApi api = new SlidesApi("MyClientId", "MyClientSecret");
byte[] file = Files.readAllBytes(Paths.get("MyPresentation.pptx"));
FontsData response = api.getFontsOnline(file, null);
System.out.println("Count of fonts used in the presentation: " + response.getList().size());
```
### Response
#### Success Response (200)
Returns a FontsData object containing the list of fonts used in the presentation.
```
--------------------------------
### Initialize Slides API in PHP
Source: https://docs.aspose.cloud/slides/add-a-shape-to-a-group-shape
Set up the Aspose. Slides Cloud SDK for PHP by configuring the API with your application's client ID and secret.
```php
// For complete examples and data files, please go to https://github.com/aspose-slides-cloud/Aspose.Slides-Cloud-SDK-for-PHP
use Aspose\Slides\Cloud\Sdk\Api\Configuration;
use Aspose\Slides\Cloud\Sdk\Api\SlidesApi;
use Aspose\Slides\Cloud\Sdk\Model\Shape;
$configuration = new Configuration();
$configuration->setAppSid("MyClientId");
$configuration->setAppKey("MyClientSecret");
```
--------------------------------
### Get Presentation Fonts (C# SDK)
Source: https://docs.aspose.cloud/slides/get-presentation-fonts
Example of how to use the Aspose.Slides Cloud SDK for C# to get font information from a presentation.
```APIDOC
## GetFontsOnline (C#)
### Description
Gets font information from a presentation file using the C# SDK.
### Method Signature
`FontsData GetFontsOnline(Stream file)`
### Parameters
#### Path Parameters
None
#### Query Parameters
None
#### Request Body
- **file** (Stream) - Required - The presentation file to analyze.
### Request Example
```csharp
SlidesApi api = new SlidesApi("MyClientId", "MyClientSecret");
Stream file = File.OpenRead("MyPresentation.pptx");
FontsData response = api.GetFontsOnline(file);
Console.WriteLine("Count of fonts used in the presentation: " + response.List.Count);
```
### Response
#### Success Response (200)
Returns a FontsData object containing the list of fonts used in the presentation.
```
--------------------------------
### Convert Presentation to PDF with Options in Ruby
Source: https://docs.aspose.cloud/slides/conversion-options
This Ruby example demonstrates converting a presentation to PDF with specific export options. It sets parameters for slide frames, JPEG quality, and PDF/UA compliance, then saves the resulting PDF file.
```ruby
# For complete examples and data files, please go to https://github.com/aspose-slides-cloud/Aspose.Slides-Cloud-SDK-for-Ruby
require "aspose_slides_cloud"
include AsposeSlidesCloud
configuration = AsposeSlidesCloud::Configuration.new
configuration.app_sid = "my_client_id"
configuration.app_key = "my_client_key"
slides_api = AsposeSlidesCloud::SlidesApi.new(configuration)
# Set options for the output PDF document.
pdf_options = AsposeSlidesCloud::PdfExportOptions.new
pdf_options.draw_slides_frame = true
pdf_options.jpeg_quality = 90
pdf_options.compliance = "PDFUA"
# Convert the presentation to PDF format.
presentation_data = File.binread("MyPresentation.pptx")
pdf_data = slides_api.convert(presentation_data, ExportFormat::PDF, nil, nil, nil, nil, pdf_options)
File.binwrite("MyPresentation.pdf", pdf_data)
```
--------------------------------
### Get Fonts using Go SDK
Source: https://docs.aspose.cloud/slides/get-presentation-fonts
Example of how to use the Aspose.Slides Cloud SDK for Go to get font data from a presentation.
```Go
import (
asposeslidescloud "github.com/aspose-slides-cloud/aspose-slides-cloud-go/v2"
"fmt"
)
// ...
cfg := asposeslidescloud.NewConfiguration()
cfg.AppSid = "MyClientId"
cfg.AppKey = "MyClientSecret"
api := asposeslidescloud.NewAPIClient(cfg)
fileName := "MyPresentation.pptx"
response, _, e := api.SlidesApi.GetFonts(fileName, "", "", "")
if e != nil {
fmt.Printf("Error: %v.", e)
return
}
fmt.Printf("Count of fonts used in the presentation: %v", len(response.GetList()))
```
--------------------------------
### Convert Presentation to PDF with Handout Layouting (Ruby)
Source: https://docs.aspose.cloud/slides/convert-using-handout-layouting-options
This Ruby example demonstrates converting a PPTX to PDF with handout layout options (2 slides per page, print slide numbers). Requires the Aspose.Slides Cloud SDK for Ruby.
```ruby
Copyconfiguration = AsposeSlidesCloud::Configuration.new
configuration.app_sid = "MyClientId"
configuration.app_key = "MyClientSecret"
api = AsposeSlidesCloud::SlidesApi.new(configuration)
slides_layout_options = AsposeSlidesCloud::HandoutLayoutingOptions.new
slides_layout_options.handout = "Handouts2"
slides_layout_options.print_slide_numbers = True
export_options = AsposeSlidesCloud::PdfExportOptions.new
export_options.slides_layout_options = slides_layout_options
result = api.download_presentation("MyPresentation.pptx", AsposeSlidesCloud::ExportFormat::PDF, export_options)
File.binwrite("MyPresentation.pdf", result)
```
--------------------------------
### Get Fonts using Node.js SDK
Source: https://docs.aspose.cloud/slides/get-presentation-fonts
Example of how to use the Aspose.Slides Cloud SDK for Node.js to get font data from a presentation.
```Node.js
const CloudSdk = require("asposeslidescloud");
// ...
const api = new CloudSdk.SlidesApi("MyClientId", "MyClientSecret");
let response = await api.getFonts("MyPresentation.pptx");
console.log("Count of fonts used in the presentation: " + response.body.list.length);
```
--------------------------------
### Track Merge Operation Status (Go)
Source: https://docs.aspose.cloud/slides/track-merge-progress
This Go example demonstrates starting a merge operation and then entering a loop to poll for its status. It prints the current status, progress, and handles potential errors or completion.
```go
// For complete examples and data files, please go to https://github.com/aspose-slides-cloud/Aspose.Slides-Cloud-SDK-for-Go
cfg := asposeslidescloud.NewConfiguration()
cfg.AppSid = "my_client_id"
cfg.AppKey = "my_client_key"
api := asposeslidescloud.NewAPIClient(cfg)
source1, e := ioutil.ReadFile("presentation1.pptx")
if e != nil {
fmt.Printf("Error: %v.", e)
return
}
source2, e := ioutil.ReadFile("presentation2.pptx")
if e != nil {
fmt.Printf("Error: %v.", e)
return
}
operationId, _, e := api.SlidesAsyncApi.StartMerge([][]byte{source1, source2}, nil, "")
if e != nil {
fmt.Printf("Error: %v.", e)
return
}
var operation asposeslidescloud.IOperation
for {
time.Sleep(time.Duration(2) * time.Second)
operation, _, e = api.SlidesAsyncApi.GetOperationStatus(operationId)
if e != nil {
fmt.Printf("Error: %v.", e)
return
}
fmt.Printf("Current operation status: %v.", operation.GetStatus())
if operation.GetStatus() != "Started" {
if operation.GetProgress() != nil {
fmt.Printf("Operation is in progress. Merged %v of %v.", operation.GetProgress().GetStepIndex(), operation.GetProgress().GetStepCount())
```
--------------------------------
### Get Fonts using Python SDK
Source: https://docs.aspose.cloud/slides/get-presentation-fonts
Example of how to use the Aspose.Slides Cloud SDK for Python to get font data from a presentation.
```Python
import asposeslidescloud
from asposeslidescloud.configuration import Configuration
from asposeslidescloud.apis.slides_api import SlidesApi
# ...
configuration = Configuration()
configuration.app_sid = 'MyClientId'
configuration.app_key = 'MyClientSecret'
api = SlidesApi(configuration)
response = api.get_fonts("MyPresentation.pptx")
print(f"Count of fonts used in the presentation: { len(response.list) }")
```
--------------------------------
### Convert Presentation to PDF with Options (Go)
Source: https://docs.aspose.cloud/slides/conversion-options
Convert a presentation to PDF using Go, setting `PdfExportOptions` for customization. Error handling is included for file reading and API calls.
```go
// For complete examples and data files, please go to https://github.com/aspose-slides-cloud/Aspose.Slides-Cloud-SDK-for-Go
cfg := asposeslidescloud.NewConfiguration()
cfg.AppSid = "my_client_id"
cfg.AppKey = "my_client_key"
api := asposeslidescloud.NewAPIClient(cfg)
source, e := ioutil.ReadFile("MyPresentation.pptx")
if e != nil {
fmt.Printf("Error: %v.", e)
return
}
// Set options for the output PDF document.
pdfOptions := asposeslidescloud.NewPdfExportOptions()
pdfOptions.DrawSlidesFrame = true
pdfOptions.JpegQuality = 90
pdfOptions.Compliance = "PdfUa"
// Convert the presentation to PDF format.
result, _, e := api.SlidesApi.Convert(source, "pdf", "", "", "", nil, pdfOptions)
if e != nil {
fmt.Printf("Error: %v.", e)
return
}
fmt.Printf("The converted document was saved to %v.", result.Name())
```