ComPDFKit Conversion SDK

Convert PDF Documents to Excel Documents


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

CPDFConvertExcelOptions *options = [[[CPDFConvertExcelOptions alloc] init] autorelease];
[options setContentOptions:CPDFConvertExcelContentAllContent];
[options setWorksheetOptions:CPDFConvertExcelWorksheetForEachPage];
// Sets the OCR language, which takes effect only when IsAllowOCR is true.
[options setIsAllowOCR:YES];
//Whether to contain images when converting,which takes effect only when IsAllowOCR is false.
[options setIsContainImages:NO];
//Sets whether to contain background images, which takes effect only when IsAllowOCR is true. 
[options setIsContainOCRBgImage:NO];
//Whether to contain annotations when converting.
[options setIsContainAnnotations:NO];
//OCR language is English
[options setLanguage:COCRLanguageEnglish];

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