Use the fontsFolder Parameter to Specify Custom Fonts Introduction
Aspose.Slides for Cloud allows you to optionally specify fontsFolder Parameter for methods that convert presentations or their parts to other formats. The fontsFolder parameter allows you to specify the location at Aspose Cloud Storage where custom font files are uploaded.
Resource
The following Aspose.Slides for Cloud REST API resource has been used in the examples: Convert .
Examples
cURL Example
SDK Examples
C#
SlidesApi api = new SlidesApi ( "MyClientId" , "MyClientSecret" );
Stream file = File . OpenRead ( "sample.pptx" );
Stream response = api . Convert ( file , ExportFormat . Pdf , fontsFolder : "fonts" );
response . CopyTo ( File . Create ( "myPresentation.pdf" ));
Java
SlidesApi api = new SlidesApi ( "MyClientId" , "MyClientSecret" );
byte [] file = Files . readAllBytes ( Paths . get ( "customfont.pptx" ));
File response = api . convert ( file , ExportFormat . PDF , null , null , "customFonts" , null , null );
System . out . println ( "The converted file was saved to " + response . getPath ());
PHP
use Aspose\Slides\Cloud\Sdk\Api\Configuration ;
use Aspose\Slides\Cloud\Sdk\Api\SlidesApi ;
use Aspose\Slides\Cloud\Sdk\Model\ExportFormat ;
$config = new Configuration ();
$config -> setAppSid ( "MyClientId" );
$config -> setAppKey ( "MyClientSecret" );
$api = new SlidesApi ( null , $config );
$file = fopen ( "customfont.pptx" , 'r' );
$result = $api -> Convert ( $file , ExportFormat :: PDF , null , null , "customFonts" );
print ( "The converted file was saved to " . $result -> getPathname ());
Ruby
Python
import asposeslidescloud
from asposeslidescloud.configuration import Configuration
from asposeslidescloud.apis.slides_api import SlidesApi
from asposeslidescloud.models.export_format import ExportFormat
configuration = Configuration ()
configuration . app_sid = 'MyClientId'
configuration . app_key = 'MyClientSecret'
api = SlidesApi ( configuration )
with open ( "customfont.pptx" , 'rb' ) as f :
input_file = f . read ()
result = api . convert ( input_file , ExportFormat . PDF , None , None , "customFonts" )
print ( 'The converted file was saved to ' + result )
Node.js
const CloudSdk = require ( "asposeslidescloud" );
const fs = require ( "fs" );
const api = new CloudSdk . SlidesApi ( "MyClientId" , "MyClientSecret" );
const file = fs . createReadStream ( "customfont.pptx" );
api . convert ( file , "pdf" , null , null , "customFonts" ). then ( response => {
fs . writeFile ( "customfont.pdf" , response . body , ( err ) => {
if ( err ) throw err ;
});
});
Go
cfg := asposeslidescloud . NewConfiguration ()
cfg . AppSid = "MyClientId"
cfg . AppKey = "MyClientSecret"
api := asposeslidescloud . NewAPIClient ( cfg )
source , e := ioutil . ReadFile ( "customfont.pptx" )
if e != nil {
fmt . Printf ( "Error: %v." , e )
return
}
result , _ , e := api . SlidesApi . Convert ( source , "pdf" , "" , "" , "customFonts" , nil , nil )
if e != nil {
fmt . Printf ( "Error: %v." , e )
return
}
fmt . Printf ( "The converted file was saved to %v." , result . Name ())
C++
Swift