Update Document Properties Introduction
Aspose.Slides allows you to update a document property in a PowerPoint presentation.
Please note that you cannot set values against the Application and Producer fields, because Aspose Ltd. and Aspose.Slides for Cloud x.x.x will be displayed against these fields.
SetDocumentProperty
API
Type
Description
Resource
/slides/{name}/documentproperties/{propertyName}
PUT
Updates a document property or creates a new one if it does not exist.
SetDocumentProperty
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.
property
object
body
true
The property data to be updated.
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 value H.G. Wells to a document property named Author in MyFolder/MyPresentation.pptx document saved to the default storage.
cURL Solution
SDK Solutions
C#
Copy
using Aspose.Slides.Cloud.Sdk ;
using Aspose.Slides.Cloud.Sdk.Model ;
using System.Diagnostics ;
class Application
{
static void Main ( )
{
var slidesApi = new SlidesApi ( "MyClientId" , "MyClientSecret" );
var property = new DocumentProperty { Name = "Author" , Value = "H.G. Wells" };
var currentProperty = slidesApi . SetDocumentProperty ( "MyPresentation.pptx" , "Author" , property , null , "MyFolder" );
Debug . WriteLine ( $"{currentProperty.Name} : {currentProperty.Value} " );
}
}
Java
Copy
import com.aspose.slides.ApiException ;
import com.aspose.slides.api.SlidesApi ;
import com.aspose.slides.model.* ;
public class Application {
public static void main ( String [] args ) throws ApiException {
SlidesApi slidesApi = new SlidesApi ( "MyClientId" , "MyClientSecret" );
DocumentProperty property = new DocumentProperty ();
property . setName ( "Author" );
property . setValue ( "H.G. Wells" );
DocumentProperty currentProperty = slidesApi . setDocumentProperty ( "MyPresentation.pptx" , "Author" , property , null , "MyFolder" , null );
System . out . printf ( "%s: %s%n" , currentProperty . getName (), currentProperty . getValue ());
}
}
PHP
Copy
use Aspose \Slides \Cloud \Sdk \Api \Configuration ;
use Aspose \Slides \Cloud \Sdk \Api \SlidesApi ;
use Aspose \Slides \Cloud \Sdk \Model \DocumentProperty ;
$configuration = new Configuration ();
$configuration -> setAppSid ( "MyClientId" );
$configuration -> setAppKey ( "MyClientSecret" );
$slidesApi = new SlidesApi ( null , $configuration );
$property = new DocumentProperty ();
$property -> setName ( "Author" );
$property -> setValue ( "H.G. Wells" );
$currentProperty = $slidesApi -> setDocumentProperty ( "MyPresentation.pptx" , "Author" , $property , null , "MyFolder" );
echo sprintf ( "%s: %s \n " , $currentProperty -> getName (), $currentProperty -> 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 = DocumentProperty . new
property . name = "Author"
property . value = "H.G. Wells"
current_property = slides_api . set_document_property ( "MyPresentation.pptx" , "Author" , property , nil , "MyFolder" )
print " #{ current_property . name } : #{ current_property . value } "
Python
Copy
import asposeslidescloud
from asposeslidescloud.apis.slides_api import SlidesApi
from asposeslidescloud.models.document_property import DocumentProperty
slides_api = SlidesApi ( None , "MyClientId" , "MyClientSecret" )
property = DocumentProperty ()
property . name = "Author"
property . value = "H.G. Wells"
current_property = slides_api . set_document_property ( "MyPresentation.pptx" , "Author" , property , None , "MyFolder" )
print ( f "{current_property.name} : {current_property.value} " )
Node.js
Copy
const cloud = require ( "asposeslidescloud" );
const slidesApi = new cloud . SlidesApi ( "MyClientId" , "MyClientSecret" );
var property = new cloud . DocumentProperty ();
property . name = "Author" ;
property . value = "H.G. Wells" ;
slidesApi . setDocumentProperty ( "MyPresentation.pptx" , "Author" , property , null , "MyFolder" ). then ( currentProperty => {
console . log ( currentProperty . body . name + ": " + currentProperty . 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 = std :: make_shared < DocumentProperty > ();
property -> setName ( L "Author" );
property -> setValue ( L "H.G. Wells" );
auto currentProperty = slidesApi -> setDocumentProperty ( L "MyPresentation.pptx" , L "Author" , property , L "" , L "MyFolder" ). get ();
std :: wcout << currentProperty -> getName () << L ": " << currentProperty -> getValue ();
std :: cin . get ();
return 0 ;
}
Perl
Copy
use AsposeSlidesCloud::Configuration ;
use AsposeSlidesCloud::SlidesApi ;
use AsposeSlidesCloud::Object::DocumentProperty ;
my $config = AsposeSlidesCloud::Configuration -> new ();
$config -> { app_sid } = "MyClientId" ;
$config -> { app_key } = "MyClientSecret" ;
my $slides_api = AsposeSlidesCloud::SlidesApi -> new ( config => $config );
my $property = AsposeSlidesCloud::Object::DocumentProperty -> new ();
$property -> { name } = "Author" ;
$property -> { value } = "H.G. Wells" ;
my %parameters = ( name => "MyPresentation.pptx" , property_name => "Author" , property => $property , folder => "MyFolder" );
my $current_property = $slides_api -> set_document_property ( %parameters );
print ( "$current_property->{name}: $current_property->{value}\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.