Set Embedded Fonts Introduction
Aspose.Slides Cloud API allows embedding a font used in a presentation. The feature can be applied to presentations located in the storage or presentations uploaded in the request body.
SetEmbeddedFont
API
Type
Description
Resource
/slides/{name}/fonts/embedded/{fontName}
POST
Embeds specified font and returns presentation fonts info.
SetEmbeddedFont
Examples
cURL Example
The code examples below show how to embed fonts in a presentation in the storage.
SDK Examples
C#
SlidesApi api = new SlidesApi ( "MyClientId" , "MyClientSecret" );
FontsData response = api . SetEmbeddedFont ( "MyPresentation.pptx" , "Calibri" , false );
Console . WriteLine ( "Font " + response . List [ 2 ]. FontName + " has been embedded." );
Java
SlidesApi api = new SlidesApi ( "MyClientId" , "MyClientSecret" );
FontsData response = api . setEmbeddedFont ( "MyPresentation.pptx" , "Calibri" , false , null , null , null , null );
System . out . println ( "Font " + response . getList (). get ( 2 ). getFontName () + " has been embedded." );
PHP
use Aspose\Slides\Cloud\Sdk\Api\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 );
$result = $api -> setEmbeddedFont ( "MyPresentation.pptx" , "Calibri" , false );
print ( "Font " . $result -> getList ()[ 2 ] -> getFontName () . " has been embedded." );
Ruby
configuration = AsposeSlidesCloud :: Configuration . new
configuration . app_sid = "MyClientId"
configuration . app_key = "MyClientSecret"
api = AsposeSlidesCloud :: SlidesApi . new ( configuration )
#Code example will be added soon.
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 . set_embedded_font ( "MyPresentation.pptx" , "Calibri" , False )
print ( "Font " + response . list [ 2 ] . font_name + " has been embedded." )
Node.js
const CloudSdk = require ( "asposeslidescloud" );
const api = new CloudSdk . SlidesApi ( "MyClientId" , "MyClientSecret" );
let result = await api . setEmbeddedFont ( "MyPresentation.pptx" , "Calibri" , false );
console . log ( "Font " + result . body . list [ 2 ]. fontName + " has been embedded." );
Go
cfg := asposeslidescloud . NewConfiguration ()
cfg . AppSid = "MyClientId"
cfg . AppKey = "MyClientSecret"
api := asposeslidescloud . NewAPIClient ( cfg )
fileName := "MyPresentation.pptx"
fontName := "Calibri"
var onlyUsed bool = false
response , _ , e := api . SlidesApi . SetEmbeddedFont ( fileName , fontName , & onlyUsed , "" , "" , "" , "" )
if e != nil {
fmt . Printf ( "Error: %v." , e )
return
}
fmt . Printf ( "Font " + response . GetList ()[ 2 ]. GetFontName () + " has been embedded." )
C++
Perl
use AsposeSlidesCloud::Configuration ;
use AsposeSlidesCloud::SlidesApi ;
use AsposeSlidesCloud::Object::SlideComment ;
my $config = AsposeSlidesCloud::Configuration -> new ();
$config -> { app_sid } = "MyClientId" ;
$config -> { app_key } = "MyClientSecret" ;
my $api = AsposeSlidesCloud::SlidesApi -> new ( config => $config );
#Code example will be added soon.
Swift
SetEmbeddedFontOnline
API
Type
Description
Resource
/slides/fonts/embedded/{fontName}
POST
Embeds specified font and returns presentation.
SetEmbeddedFontOnline
Examples
cURL Example
The code examples below show how to embed fonts in a presentation in the request body.
SDK Examples
C#
SlidesApi api = new SlidesApi ( "MyClientId" , "MyClientSecret" );
Stream file = File . OpenRead ( "MyPresentation.pptx" );
api . SetEmbeddedFontOnline ( file , "Calibri" , false );
Console . WriteLine ( "Font Calibri has been embedded." );
Java
SlidesApi api = new SlidesApi ( "MyClientId" , "MyClientSecret" );
byte [] file = Files . readAllBytes ( Paths . get ( "MyPresentation.pptx" ));
api . setEmbeddedFontOnline ( file , "Calibri" , false , null , null );
System . out . println ( "Font Calibri has been embedded." );
PHP
use Aspose\Slides\Cloud\Sdk\Api\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' );
$api -> setEmbeddedFontOnline ( $file , "Calibri" , false );
print ( "Font Calibri has been embedded." );
Ruby
configuration = AsposeSlidesCloud :: Configuration . new
configuration . app_sid = "MyClientId"
configuration . app_key = "MyClientSecret"
api = AsposeSlidesCloud :: SlidesApi . new ( configuration )
#Code example will be added soon.
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 ()
api . set_embedded_font_online ( source , "Calibri" , False )
print ( "Font Calibri has been embedded." )
Node.js
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 . setEmbeddedFontOnline ( stream , "Calibri" , false );
console . log ( "Font Calibri has been embedded." );
Go
cfg := asposeslidescloud . NewConfiguration ()
cfg . AppSid = "MyClientId"
cfg . AppKey = "MyClientSecret"
api := asposeslidescloud . NewAPIClient ( cfg )
document , e := ioutil . ReadFile ( "MyPresentation.pptx" )
fontName := "Calibri"
var onlyUsed bool = false
_ , _ , e = api . SlidesApi . SetEmbeddedFontOnline ( document , fontName , & onlyUsed , "" , "" )
if e != nil {
fmt . Printf ( "Error: %v." , e )
return
}
fmt . Printf ( "Font Calibri has been embedded." )
C++
Perl
use AsposeSlidesCloud::Configuration ;
use AsposeSlidesCloud::SlidesApi ;
use AsposeSlidesCloud::Object::SlideComment ;
my $config = AsposeSlidesCloud::Configuration -> new ();
$config -> { app_sid } = "MyClientId" ;
$config -> { app_key } = "MyClientSecret" ;
my $api = AsposeSlidesCloud::SlidesApi -> new ( config => $config );
#Code example will be added soon.
Swift
SDK Source
The Aspose for Cloud SDKs can be downloaded from the following page: Available SDKs