PowerPoint presentations are widely used for sharing information, delivering impactful visual content, and engaging audiences. However, working with different versions of PowerPoint files can sometimes lead to compatibility issues, especially when transitioning from the older PPT format to the newer PPTX format. This is where the need for PPT to PPTX conversion arises. Converting your PPT files to PPTX offers numerous benefits, including improved file compatibility, enhanced features and functionality, and better integration with modern presentation tools. Also, for backward compatibility reasons or specific requirements, we may have a need to convert PPTX files to PPT format. So in this article, we will explore the seamless process of converting PPT to PPTX and vice versa using the .NET REST API.
- REST API for PPT to PPTX Conversion
- PPT to PPTX Conversion with C# .NET
- PPTX to PPT Conversion using cURL Commands
REST API for PPT to PPTX Conversion
To accomplish the PPT to PPTX conversion, we can leverage the power of Aspose.Slides Cloud SDK for .NET. It provides a comprehensive set of APIs and features that allow seamless conversion between different PowerPoint presentation formats. The REST API offers a user-friendly interface and extensive documentation, making the conversion process smooth and efficient. Furthermore, it ensures the accuracy and fidelity of output when converting PPT to PPTX or PPTX to PPT format, so that you can deliver professional presentations with ease.
The first step is to search Aspose.Slides-Cloud
in NuGet packages manager inside Visual Studio IDE and click the Add Package
button. Secondly, obtain your client credentials from cloud dashboard by logging in using Google or GitHub account. In case you do not have an existing account, simply create a free account by following the instructions specified over quick start.
PPT to PPTX Conversion with C# .NET
In this section, we are going to explore the details and code snippet for converting PPT to PPTX using a simple and easy approach.
Now let’s explore the details about above stated code snippet.
SlidesApi slidesApi = new SlidesApi(clientID, clientSecret);
Firstly, create an object of SlidesApi class where we pass the client credentials as input arguments.
var output = slidesApi.DownloadPresentation(inputPowerPoint, ExportFormat.Pptx);
Call the API to load PPT stored in cloud storage and convert all slides to PPTX format.
using var pdfStream = File.Create("convertedPresentation.pptx");
images.CopyTo(pdfStream);
pdfStream.Close();
Save the resultant PPTX on local drive.
The API also provides the capability to only convert selected slides. So in order to accomplish this requirement, please pass a List object containing respective slides index as an argument to
DownloadPresentation(...)
method.
List<int> selectdSlides = new List<int> { 1, 3};
// Get all text items from the presentation.
var output = slidesApi.DownloadPresentation(inputPowerPoint, ExportFormat.Pptx, slides: selectdSlides);
The sample PowerPoint Presentation used in the above example can be downloaded from Architecture pitch deck.pptx.
PPTX to PPT Conversion using cURL Commands
To convert PPTX to PPT using cURL commands and Aspose.Slides Cloud, you can leverage the powerful RESTful APIs provided by Aspose.Slides Cloud. With cURL commands, you can easily interact with the Aspose.Slides Cloud API endpoints and perform the conversion operation. By making HTTP requests with the appropriate parameters and authentication, you can seamlessly convert your PPTX files to the PPT format.
To get started with this approach, first we need to generate a JWT access token by executing the following command:
curl -v "https://api.aspose.cloud/connect/token" \
-X POST \
-d "grant_type=client_credentials&client_id=bb959721-5780-4be6-be35-ff5c3a6aa4a2&client_secret=4d84d5f6584160cbd91dba1fe145db14" \
-H "Content-Type: application/x-www-form-urlencoded" \
-H "Accept: application/json"
Now, please execute the following command to convert all slides in PPTX presentation available in cloud storage to PPT format. After conversion, the output is saved to cloud storage.
curl -v "https://api.aspose.cloud/v3.0/slides/{sourcePPTX}/Ppt"
-X POST \
-H "accept: multipart/form-data" \
-H "authorization: Bearer {accessToken}" \
-H "Content-Type: application/json" \
-d "{}" \
-o "{resultantFile}"
Replace sourcePPTX
with the name of an input PPTX available in cloud storage, resultantFile
with the name of resultant PPT and accessToken
with JWT access token generated above.
Conclusion
In conclusion, converting PPT to PPTX is a valuable capability that allows you to leverage the enhanced features and compatibility of the PPTX format. Furthermore, this conversion greatly reduces the size of resultant PowerPoint file. Similarly, we can also achieve a backward compatibility when converting PPTX to PPT format. Now in order to accomplish this requirement, either try using .NET REST API which offers rich set of features and ease of integration with .NET applications. Or, use the cURL commands in conjunction with Aspose.Slides Cloud API, enabling a flexible and scalable approach, allowing you to harness the power of the cloud infrastructure.
So choose the approach that best suits your development environment and requirements, and unlock the potential of PowerPoint presentations conversion capabilities.
Useful Links
Related Articles
We highly recommend visiting the following blogs: