Read Document Properties Introduction
This article shows you how to read document properties from a PowerPoint presentation. The methods below allow you to read standard and custom properties. A document property is a name and value pair.
GetDocumentProperties
API
Type
Description
Resource
/slides/{name}/documentproperties
GET
Reads all document properties from a presentation.
GetDocumentProperties
Request Parameters
Name
Type
Location
Required
Description
name
string
path
true
The name of a presentation file.
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
Read all document properties from MyFolder/MyPresentation.pptx document saved to the default storage. Use MyPassword string to open the protected presentation.
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"
Read Document Properties
Copy curl -X GET "https://api.aspose.cloud/v3.0/slides/MyPresentation.pptx/documentproperties?folder=MyFolder" \
-H "authorization: Bearer <access_token>" \
-H "password: MyPassword"
Response
Response Example
Copy {
"list" : [
{
"name" : "Author" ,
"value" : "Jhon Smith" ,
"builtIn" : true ,
"selfUri" : {
"href" : "https://api.aspose.cloud/v3.0/slides/MyPresentation.pptx/documentProperties/Author?folder=MyFolder" ,
"relation" : "self"
}
},
{
"name" : "Company" ,
"value" : "Aspose" ,
"builtIn" : true ,
"selfUri" : {
"href" : "https://api.aspose.cloud/v3.0/slides/MyPresentation.pptx/documentProperties/Company?folder=MyFolder" ,
"relation" : "self"
}
},
{
"name" : "Template" ,
"value" : "" ,
"builtIn" : true ,
"selfUri" : {
"href" : "https://api.aspose.cloud/v3.0/slides/MyPresentation.pptx/documentProperties/Template?folder=MyFolder" ,
"relation" : "self"
}
}
],
"selfUri" : {
"href" : "https://api.aspose.cloud/v3.0/slides/MyPresentation.pptx/documentProperties?folder=MyFolder" ,
"relation" : "self"
}
}
SDK Solutions
C#
Copy
using Aspose.Slides.Cloud.Sdk ;
using System.Diagnostics ;
class Application
{
static void Main ( )
{
var slidesApi = new SlidesApi ( "MyClientId" , "MyClientSecret" );
var properties = slidesApi . GetDocumentProperties ( "MyPresentation.pptx" , "MyPassword" , "MyFolder" );
foreach ( var property in properties . List )
{
Debug . WriteLine ( $"{property.Name} : {property.Value} " );
}
}
}
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" );
DocumentProperties properties = slidesApi . getDocumentProperties ( "MyPresentation.pptx" , "MyPassword" , "MyFolder" , null );
for ( DocumentProperty property : properties . getList ()) {
System . out . printf ( "%s: %s%n" , property . getName (), property . getValue ());
}
}
}
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 );
$properties = $slidesApi -> getDocumentProperties ( "MyPresentation.pptx" , "MyPassword" , "MyFolder" );
foreach ( $properties -> getList () as $property ) {
echo sprintf ( "%s: %s \n " , $property -> getName (), $property -> getValue ());
}
Ruby
Copy
require "aspose_slides_cloud"
include AsposeSlidesCloud
configuration = Configuration . new
configuration . app_sid = "MyClientId"
configuration . app_key = "MyClientSecret"
slides_api = SlidesApi . new ( configuration )
properties = slides_api . get_document_properties ( "MyPresentation.pptx" , "MyPassword" , "MyFolder" )
for property in properties . list
puts " #{ property . name } : #{ property . value } "
end
Python
Copy
import asposeslidescloud
from asposeslidescloud.apis.slides_api import SlidesApi
slides_api = SlidesApi ( None , "MyClientId" , "MyClientSecret" )
properties = slides_api . get_document_properties ( "MyPresentation.pptx" , "MyPassword" , "MyFolder" )
for property in properties . list :
print ( f "{property .name} : {property .value} " )
Node.js
Copy
const cloud = require ( "asposeslidescloud" );
const slidesApi = new cloud . SlidesApi ( "MyClientId" , "MyClientSecret" );
slidesApi . getDocumentProperties ( "MyPresentation.pptx" , "MyPassword" , "MyFolder" ). then ( properties => {
properties . body . list . forEach ( property => {
console . log ( property . name + ": " + property . value );
});
});
C++
Copy
#include "asposeslidescloud/api/SlidesApi.h"
using namespace asposeslidescloud :: api ;
int main ()
{
auto slidesApi = new SlidesApi ( L "MyClientId" , L "MyClientSecret" );
auto properties = slidesApi -> getDocumentProperties ( L "MyPresentation.pptx" , L "MyPassword" , L "MyFolder" ). get ();
for ( auto property : properties -> getList ()) {
std :: wcout << property -> getName () << L ": " << property -> getValue () << std :: endl ;
}
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" , password => "MyPassword" , folder => "MyFolder" );
my $properties = $slides_api -> get_document_properties ( %parameters );
for my $property ( @ { $properties -> { list }}) {
print ( "$property->{name}: $property->{value}\n" );
}
Swift
Go
GetDocumentProperty
API
Type
Description
Resource
/slides/{name}/documentproperties/{propertyName}
GET
Reads a document property from a presentation.
GetDocumentProperty
Request Parameters
Name
Type
Location
Required
Description
name
string
path
true
The name of a presentation file.
propertyName
string
path
true
The name of a document property.
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
Read the document property named Author from 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 property = slidesApi . GetDocumentProperty ( "MyPresentation.pptx" , "Author" , null , "MyFolder" );
Debug . WriteLine ( property . Value );
}
}
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" );
DocumentProperty property = slidesApi . getDocumentProperty ( "MyPresentation.pptx" , "Author" , null , "MyFolder" , null );
System . out . println ( property . getValue ());
}
}
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 );
$property = $slidesApi -> getDocumentProperty ( "MyPresentation.pptx" , "Author" , null , "MyFolder" );
print ( $property -> getValue ());
Ruby
Copy
require "aspose_slides_cloud"
include AsposeSlidesCloud
configuration = Configuration . new
configuration . app_sid = "MyClientId"
configuration . app_key = "MyClientSecret"
slides_api = SlidesApi . new ( configuration )
property = slides_api . get_document_property ( "MyPresentation.pptx" , "Author" , nil , "MyFolder" )
print property . value
Python
Copy
import asposeslidescloud
from asposeslidescloud.apis.slides_api import SlidesApi
slides_api = SlidesApi ( None , "MyClientId" , "MyClientSecret" )
property = slides_api . get_document_property ( "MyPresentation.pptx" , "Author" , None , "MyFolder" )
print ( property . value )
Node.js
Copy
const cloud = require ( "asposeslidescloud" );
const slidesApi = new cloud . SlidesApi ( "MyClientId" , "MyClientSecret" );
slidesApi . getDocumentProperty ( "MyPresentation.pptx" , "Author" , null , "MyFolder" ). then ( property => {
console . log ( property . body . value );
});
C++
Copy
#include "asposeslidescloud/api/SlidesApi.h"
using namespace asposeslidescloud :: api ;
int main ()
{
auto slidesApi = new SlidesApi ( L "MyClientId" , L "MyClientSecret" );
auto property = slidesApi -> getDocumentProperty ( L "MyPresentation.pptx" , L "Author" , L "" , L "MyFolder" ). get ();
std :: wcout << property -> getValue ();
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" , property_name => "Author" , folder => "MyFolder" );
$property = $slides_api -> get_document_property ( %parameters );
print ( $property -> { value });
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.