extractPdfText method

Future<String?> extractPdfText(
  1. String path
)

Extracts text from a PDF file using OCR.

This method processes the PDF file at the given path and extracts all text content using optical character recognition. The method automatically detects the file type and uses the appropriate extraction method (PDF, DOCX, or CSV).

Returns the extracted text as a String, or null if extraction fails or the file type is not supported.

The path parameter should be a valid file system path to the document.

Example:

final text = await client.extractPdfText('/path/to/document.pdf');
if (text != null) {
  print('Extracted text: $text');
}

Implementation

Future<String?> extractPdfText(String path) async =>
    Extractor.extract(path: path);