extractTextFromMultipleImages method
Extract text from multiple images (for multi-page documents).
Implementation
Future<String> extractTextFromMultipleImages(List<String> imagePaths) async {
String fullText = '';
for (int i = 0; i < imagePaths.length; i++) {
try {
final String pageText = await extractTextFromImage(imagePaths[i]);
if (pageText.isNotEmpty) {
if (fullText.isNotEmpty) fullText += '\n\n';
fullText += '--- Page ${i + 1} ---\n';
fullText += pageText;
}
} catch (e) {
dev.log('Error processing image ${i + 1}: $e');
}
}
return fullText;
}