iOS
ComPDFKit Conversion SDK
Guides

Convert PDF Documents to TXT Documents

 

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

CPDFConvertTxtOptions * options = [[[CPDFConvertTxtOptions alloc] init] autorelease];
[options setIsAllowOCR:YES];
[options setLanguage:COCRLanguageEnglish];

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