PDF to PowerPoint

PDF to PowerPoint Converter with C# .NET.

By converting PDF files to PowerPoint presentations, we can unlock a world of possibilities, offering flexibility, interactivity, and enhanced visual appeal. With this seamless transition from static documents to dynamic slideshows, you gain the power to engage wider audience in a more captivating manner. So, whether you’re looking to repurpose existing content, create professional presentations, or enhance collaboration in the workplace, converting PDF to PowerPoint using C# .NET provides a versatile solution.

This article covers following topics:

REST API for PDF to PowerPoint Conversion

With GroupDocs.Conversion Cloud SDK for .NET, converting PDF to PowerPoint becomes a seamless and efficient process. This powerful SDK offers comprehensive capabilities to handle various file conversion tasks, including PDF to PowerPoint conversion. This Cloud SDK ensures high-quality output, preserving the formatting, layout, and content of the original PDF files in the resulting PowerPoint slides. Additionally, it provides extensive customization options, allowing users to tailor the conversion process according to their specific requirements.

Now, the first step is its installation. So, search GroupDocs.Conversion-Cloud in NuGet package manager and click the Install button. Another option is to execute the following command in package manager console.

NuGet\Install-Package GroupDocs.Conversion-Cloud -Version 24.2.0

Once the REST API is successfully installed, make sure you have the API credentials(i.e. Client ID and Client Secret). You may visit this short tutorial to see how to get the API credentials.

Convert PDF to PPT using C# .NET

Let’s explore the details on how to seamlessly integrate the PDF to PPT presentation conversion into .NET applications.

  1. Create an instance of Configuration class where we pass client credentials as arguments.
var configurations = new Configuration(clientId, clientSecret1);
  1. Initialize the ConvertApi where we pass Configuration object as an input argument.
var apiInstance = new ConvertApi(configurations);
  1. Upload the input PDF file to cloud storage while passing the name for input PDF document.
fileUpload.UploadFile(new UploadFileRequest("marketing.pdf", stream));
  1. Create an instance ConvertSettings where we specify the name for input PDF, output format as ppt and the name for resultant PPT file.
var settings = new ConvertSettings{...}
  1. Call the ConvertDocumentRequest API to convert PDF to PPT format.
var response = apiInstance.ConvertDocument(new ConvertDocumentRequest(settings));
// More examples over https://github.com/groupdocs-conversion-cloud/groupdocs-conversion-cloud-dotnet
// Obtain your API credentials
string clientId = "4bdefca3-f08c-4088-9ca0-55c38f4b7f22";
string clientSecret1 = "a43c8b4365246a062688a259abe5b469";
// Create an instance of the Configuration class and initialize it with the Client ID & Client Secret.
var configurations = new GroupDocs.Conversion.Cloud.Sdk.Client.Configuration(clientId, clientSecret1);
// Define the value of ApiBaseUrl to set the base url for PDF to PPT conversion API.
configuration.ApiBaseUrl = "https://api.groupdocs.cloud";
// Initialize an instance of the ConvertApi class with the object of the Configuration class.
var apiInstance = new GroupDocs.Conversion.Cloud.Sdk.Api.ConvertApi(configurations);
// load the input Excel workbook from local drive
using (var stream = System.IO.File.OpenRead("marketing.pdf"))
{
// create an instance of FileApi
var fileUpload = new FileApi(configurations);
// upload the input PDF to cloud storage
fileUpload.UploadFile(new UploadFileRequest("marketing.pdf", stream));
// create ConvertSettings where we define the input PDF file and the name for resultant PPT
var settings = new ConvertSettings
{
StorageName = "internal",
FilePath = "marketing.pdf",
Format = "ppt",
OutputPath = "resultant.ppt"
};
// Invoke the ConvertDocument method for PDF to PPT conversion.
var response = apiInstance.ConvertDocument(new ConvertDocumentRequest(settings));
if (response != null && response.Equals("OK"))
{
// print success message
Console.WriteLine("The PDF to PowerPoint conversion completed successfully !");
}
}
view raw pdf-to-ppt.cs hosted with ❤ by GitHub
PDF to PPT

Image:- PDF to PPT conversion preview.

The sample PDF file and the resultant PowerPoint presentation generated in above example can be downloaded from input.pdf and resultantFile.ppt.

PDF to PPTX using cURL Commands

Converting PDF to PPTX using GroupDocs.Conversion Cloud and cURL commands offers a convenient and flexible solution for users who prefer command-line interfaces or need to integrate conversion tasks into their scripts or workflows. Furthermore, with GroupDocs.Conversion Cloud, you can easily convert PDF documents to PPTX presentations using simple cURL commands.

Firstly, we need to obtain your personalized credentials (App Key and App SID) and generate JWT access token. Once we have JWT token, please execute the following cURL command to save PDF as PowerPoint presentation.

curl -v "https://api.groupdocs.cloud/v2.0/conversion" \
-X POST \
-H "accept: application/json" \
-H "authorization: Bearer {accessToken}" \
-H "Content-Type: application/json" \
-d "{  \"StorageName\": \"internal\",  \"FilePath\": \"{sourceFile}\",  \"Format\": \"ppt\",  \"LoadOptions\": {    \"Format\": \"pdf\"  }, \"WatermarkOptions\": {      \"Text\": \"Confidencial\",      \"FontName\": \"Arial\",      \"FontSize\": 16,      \"Bold\": true,      \"Italic\": true,      \"Color\": \"Red\",      \"Width\": 10,      \"Height\": 10,      \"Top\": 100,      \"Left\": 100,      \"RotationAngle\": 45,      \"Transparency\": 1,      \"Background\": true,      \"AutoAlign\": true    }  },  \"OutputPath\": \"{resultantFile}\"}" \
-o "{finalOutput}"

Please replace sourceFile with the name of input PDF file available in cloud storage, resultantFile with the name of output PowerPoint presentation to be generated and accessToken with JWT token generated above.

Our Free PDF to PPT Converter

You may consider using our free, lightweight and super-efficient PDF to PPT Converter developed on top of GroupDocs.Conversion API.

free pdf to ppt app

Conclusion

In conclusion, whether you opt for GroupDocs.Conversion Cloud SDK for .NET or utilize cURL commands with GroupDocs.Conversion Cloud, you’ll find robust solutions for your PDF to PowerPoint conversion needs. With extensive documentation and a rich feature set, this SDK provides a reliable and efficient solution for handling conversion tasks. Similarly, the usage of cURL commands with GroupDocs.Conversion Cloud offers a flexible and scriptable approach, allowing you to perform conversions via command-line interfaces or integrate them into automated workflows.

We highly recommend visiting the following links to learn more about: