Tutorials

Convert PDF to PPTX in Objective-C, Kotlin, and C#

By ComPDFKit | Thu. 14 Nov. 2024
Conversion

The powerful ComPDFKit Conversion SDK enables developers to embed the function of conversion into their apps. In this article, we are going to explain how we can convert PDF to editable PowerPoint. First, let’s get a clear understanding of PDF and PPTX. If you are interested in our Conversion SDK, get a free trial.

 

 

PDF vs PowerPoint

 

Thanks to its un-editable original content, PDF is widely used in ebooks, instructional & learning materials, legal documents, etc. You can spread electronic document in PDFs to avoid someone changing your content. Another reason why people love PDFs is that PDFs would present content on all platforms in the same way without worrying about layout issues.

 

PowerPoint is another useful electronic file format for working. PPTX is the default presentation file format for new PowerPoint presentations. PPTX files have become one of the most common file types for saving presentations. With rich predefined functions like the order of presentation, PowerPoint is used to present the content of public speeches, work reports, proposals, etc. To make ourselves clear and logical, we always need to turn our other formats’ materials into PPTX.

 

They have different advantages. In some cases, the information contained in a PDF file needs to be presented as a PowerPoint presentation. We can see many conversion tools on different kinds of devices. Do you know how to convert PDF to PPTX successfully? Let’s see the method in Objective-C, Kotlin, and C#.

 

 

PDF to PPTX

 

With the ComPDFKit Conversion SDK, converting PDF documents to PPTX documents can be distinguished into several situations. 

  • One PDF Document: You can customize the pages you want to convert, and there are also some choices like odd/even pages and current/all the pages. 
  • Multiple Document: When you have several PDF files, we can also provide a batch process to convert all your documents.

The following are the methods in different development languages:

 

Objective-C

// Get the path of the PDF file.
NSString *pdfPath = @"...";
// Get the path to the PPT file.
NSString *outputPath = @"...";

CPDFConverterPPT *converter = [[[CPDFConverterPPT alloc] initWithURL:[NSURL fileURLWithPath:pdfPath] password:nil] autorelease];
[converter convertToFilePath:outputPath pageIndexs:nil options:nil];

 

Kotlin

val cPDFConvert = CPDFConverterPPT(context, uri, "")

val params = CPDFConvertPPTOptions().apply {
     imgPixel = ImgPixel.IMG_300
     ...
}

val result: ConvertError = cPDFConvert.convert(outputDir, outputfilename, params, pageArrays, 
onHandle = onHandleCal, 
onProgress = onProgressCal, 
onPost = onPostCal)

 

C#

string resPath = "***";
string inputFilePath = "***";
string outputFolderPath = "***";
string outputFileName = "***";

CPDFConverter.Init(resPath);
CPDFConverterPPT converter = new CPDFConverterPPT(inputFilePath);

int pageCount = converter.GetPagesCount();
int[] pageArray = new int[pageCount];
for (int i = 0; i < pageArray.Length; i++)
{
    pageArray[i] = i + 1;
}

CPDFConverterError error = CPDFConverterError.ErrorUnknown;
converter.Convert(outputFolderPath,ref outputFileName, pageArray, ref error, getPorgress);

 

 

Get the Package Now!

 

Click to get a free trial of our ComPDFKit Conversion SDK. First, email our sales so that we can give you the package you want, and you will receive the complete SDK package that includes the library, API, demo, license file, etc. For more information, you can turn to our documentation page.

 

 

Final Words!

 

There are a lot of conversion formats that we support. Please turn to our website for more details.