PTOCRProcessor
@interface PTOCRProcessor : NSObject
The PTOCRProcessor class performs Optical Character Recognition (OCR) on the content of a PDF
and applies the recognized text results to each page.
-
Initializes a
PTOCRProcessorinstance.Declaration
Objective-C
- (nonnull instancetype)init;Swift
init()Return Value
An initialized
PTOCRProcessorinstance.
-
Performs OCR and applies the results to the specified PDF document.
Declaration
Objective-C
- (void)processDocument:(nonnull PTPDFDoc *)pdfDoc withCompletionHandler: (nonnull void (^)(BOOL, NSError *_Nullable))completionHandler;Swift
func processDocument(_ pdfDoc: PTPDFDoc) async throwsParameters
pdfDocThe PDF document to be processed.
completionHandlerThe completion handler to be called when processing is finished. If the document was processed successfully then the
successparameter isYES, otherwise theerrorparameter contains more information about the failure. -
Performs OCR and applies the results to the specified page in the PDF document.
Declaration
Objective-C
- (void)processPageNumber:(int)pageNumber inDocument:(nonnull PTPDFDoc *)pdfDoc withCompletionHandler: (nonnull void (^)(BOOL, NSError *_Nullable))completionHandler;Swift
func processPageNumber(_ pageNumber: Int32, inDocument pdfDoc: PTPDFDoc) async throwsParameters
pageNumberThe number of the PDF page to be processed.
pdfDocThe PDF document to be processed.
completionHandlerThe completion handler to be called when processing is finished. If the document was processed successfully then the
successparameter isYES, otherwise theerrorparameter contains more information about the failure. -
Cancels all in-progress OCR processing.
Declaration
Objective-C
- (void)cancel;Swift
func cancel()
PTOCRProcessor Class Reference