Extract Shapes from a Slide Using a Third Party Storage Introduction
This article shows you how to extract shapes from a slide in PowerPoint presentation saved to third-party storage. The code examples below use GetShapes
method described in Get Shapes from a Slide .
You need to configure third-party storage with Aspose Cloud before using these examples. Follow the instructions at
this page to configure your required storage.
Examples
Read information about all shapes placed on the second slide from MyFolder/MyPresentation.pptx document saved to Google Drive Storage. The storage is called MyGoogleStorage in Aspose Cloud.
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 shapes = slidesApi . GetShapes ( "MyPresentation.pptx" , 2 , null , "MyFolder" , "MyGoogleStorage" );
Console . WriteLine ( $"The second slide contains {shapes.ShapesLinks.Count} shapes." );
}
}
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" );
Shapes shapes = slidesApi . getShapes ( "MyPresentation.pptx" , 2 , null , "MyFolder" , "MyGoogleStorage" , null , null );
System . out . println ( "The second slide contains " + shapes . getShapesLinks (). size () + " shapes." );
}
}
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 );
$shapes = $slidesApi -> getShapes ( "MyPresentation.pptx" , 2 , null , "MyFolder" , "MyGoogleStorage" );
print ( "The second slide contains " . count ( $shapes -> getShapesLinks ()) . " shapes." );
Ruby
Copy
require "aspose_slides_cloud"
include AsposeSlidesCloud
configuration = Configuration . new
configuration . app_sid = "MyClientId"
configuration . app_key = "MyClientSecret"
slides_api = SlidesApi . new ( configuration )
shapes = slides_api . get_shapes ( "MyPresentation.pptx" , 2 , nil , "MyFolder" , "MyGoogleStorage" )
print "The second slide contains #{ shapes . shapes_links . length } shapes."
Python
Copy
import asposeslidescloud
from asposeslidescloud.apis.slides_api import SlidesApi
slides_api = SlidesApi ( None , "MyClientId" , "MyClientSecret" )
shapes = slides_api . get_shapes ( "MyPresentation.pptx" , 2 , None , "MyFolder" , "MyGoogleStorage" )
print ( f "The second slide contains {len (shapes.shapes_links)} shapes." )
Node.js
Copy
const cloud = require ( "asposeslidescloud" );
const slidesApi = new cloud . SlidesApi ( "MyClientId" , "MyClientSecret" );
slidesApi . getShapes ( "MyPresentation.pptx" , 2 , null , "MyFolder" , "MyGoogleStorage" ). then ( shapes => {
console . log ( "The second slide contains " + shapes . body . shapesLinks . length + " shapes." );
});
C++
Copy
#include "asposeslidescloud/api/SlidesApi.h"
using namespace asposeslidescloud :: api ;
int main ()
{
auto slidesApi = new SlidesApi ( L "MyClientId" , L "MyClientSecret" );
auto shapes = slidesApi -> getShapes ( L "MyPresentation.pptx" , 2 , L "" , L "MyFolder" , L "MyGoogleStorage" ). get ();
std :: wcout << "The second slide contains " << shapes -> getShapesLinks (). size () << " shapes." ;
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 );
my %parameters = ( name => "MyPresentation.pptx" , slide_index => 2 , folder => "MyFolder" , storage => "MyGoogleStorage" );
my $shapes = $slides_api -> get_shapes ( %parameters );
print "The second slide contains " . scalar @ { $shapes -> { shapes_links }} . " shapes." ;
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.