Custom Fonts Slowing Down Slides Cloud API Call (Python Library)

Hi, we are a customer on the Cloud Total Plan. We are using Aspose to convert slides to images using the Python library. For convert Slides to images using Aspose Slides Cloud API via Python package, if we provide font folder as an argument to the convert call, does it slow down the API call? We have noticed the request time go from 20 seconds to around 145 seconds after adding the font folder option. Right now we are using the internal storage but eventually we would move towards our own S3 bucket. The code we used is given below:

configuration = asposeslidescloud.Configuration()
configuration.app_sid = ASPOSE_CLIENT_ID
configuration.app_key = ASPOSE_CLIENT_SECRET
slidesApi = asposeslidescloud.SlidesApi(configuration)

options = ImageExportOptions()
options.width = new_width
options.height = new_height
options.show_hidden_slides = True
  
thread = slidesApi.convert(ppt_bytes_data, format=ExportFormat.PNG, options=options, fonts_folder="custom_fonts", is_async=True)

Can someone help me understand how custom fonts work? We have a lot of custom font files that we want to add via our own S3 bucket, but our concern is it should not slow down the API calls. Also do we need to provide the exact path of the font file used in the presentation or just the bucket is enough and Aspose Cloud can find the font file from the folder? Is there a way to optimize the API calls further?

@softwarets

When you provide a font folder as an argument to the convert call in the Aspose Slides Cloud API using the Python library, it can indeed slow down the API call. This is likely due to the additional time required to load and process the custom fonts from the specified folder.

If you have noticed a significant increase in request time, from 20 seconds to around 145 seconds, it suggests that the API is spending considerable time accessing and loading the fonts. This can be particularly pronounced if you have a large number of custom font files.

Understanding Custom Fonts in Aspose Slides

  1. Font Folder Usage: When you specify a font folder, the API needs to check and load the fonts from that location. If the folder contains many fonts or if the fonts are large, this can lead to increased processing time.

  2. Path Specification: When using your own S3 bucket for fonts, you need to ensure that the API can access the fonts correctly. You typically need to provide the path to the font files within the bucket, not just the bucket name. This means specifying the exact path where the font files are stored.

  3. Optimization Suggestions:

    • Reduce Font Count: If possible, limit the number of custom fonts you are using to only those necessary for your presentations.
    • Use Built-in Fonts: Consider using built-in fonts that are already available in the API, as this can significantly reduce processing time.
    • Asynchronous Processing: If you are not already doing so, consider using asynchronous calls to handle the conversion process, which can help manage longer processing times without blocking your application.
  4. Testing with Fewer Fonts: You might want to test the API call with a reduced set of fonts to see if the performance improves. This can help identify if specific fonts are causing the slowdown.

By following these guidelines, you can better manage the performance of your API calls when using custom fonts. If you continue to experience issues, consider reaching out to Aspose support for further assistance.

Example Code Snippet

Here’s a simplified example of how you might set up your API call with a font folder:

configuration = asposeslidescloud.Configuration()
configuration.app_sid = ASPOSE_CLIENT_ID
configuration.app_key = ASPOSE_CLIENT_SECRET
slidesApi = asposeslidescloud.SlidesApi(configuration)

options = ImageExportOptions()
options.width = new_width
options.height = new_height
options.show_hidden_slides = True

# Ensure the fonts folder path is correct
thread = slidesApi.convert(ppt_bytes_data, format=ExportFormat.PNG, options=options, fonts_folder="path/to/your/font/folder", is_async=True)

Make sure to replace "path/to/your/font/folder" with the actual path to your fonts in the S3 bucket.

If you have any further questions or need additional assistance, feel free to ask!

Can I get a full list of the Built in Fonts that are supported by the Aspose Cloud API?

@softwarets,
Thank you for contacting free support.

We have opened the following new ticket(s) in our internal issue tracking system and will consider your questions according to the terms mentioned in Free Support Policies.

Issue ID(s): SLIDESCLOUD-2043

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.

Could you please also specify the version of Aspose.Slides Cloud SDK for Python you are using?

I am using asposeslidescloud version = 24.12.0

@softwarets,
Thank you for the additional information. I’ve forwarded it to our developers.

Also can you let us know if fonts embedded into slides using Powerpoint are used while converting the slides to PNG? I have tried embedding fonts into slide and converting it to PNG images but the converted image is having a completely different font.

@softwarets,
Yes, embedded fonts are used when converting slides to images. Could you please share a sample presentation file and the output images so that we can investigate the case?