How to convert PowerPoint PPTX to PDF in Salesforce Apex
1 min readFeb 16, 2020
There are many reasons to convert a PPTX into a PDF, whether it’s for web compatibility, printing, etc. Regardless, you need a quick and easy solution. Well, you came to the right place.
To kick things off, download our API here and copy the /client folder into your project.
Now call convertDocumentPptxToPdf:
SwagConvertDocumentApi api = new SwagConvertDocumentApi();SwagClient client = api.getClient();// Configure API key authorization: ApikeyApiKeyAuth Apikey = (ApiKeyAuth) client.getAuthentication('Apikey');Apikey.setApiKey('YOUR API KEY');Map<String, Object> params = new Map<String, Object>{'inputFile' => Blob.valueOf('Sample text file\nContents')};try {// cross your fingersBlob result = api.convertDocumentPptxToPdf(params);System.debug(result);} catch (Swagger.ApiException e) {// ...handle your exceptions}
Done! Not bad, right? This same approach is available for hundreds of other useful similar functions through our APIs. These include numerous format conversions, document editing, and more.