platform_ocr 1.0.0 copy "platform_ocr: ^1.0.0" to clipboard
platform_ocr: ^1.0.0 copied to clipboard

A high-performance, local OCR package for Dart and Flutter that leverages native OS APIs.

example/platform_ocr_example.dart

import 'package:platform_ocr/platform_ocr.dart';
import 'dart:io';

void main() async {
  final ocr = PlatformOcr();
  final imageFile = File('example/flutter_logo.png');

  if (!await imageFile.exists()) {
    print('Error: example/flutter_logo.png not found.');
    return;
  }

  print('Recognizing text from: ${imageFile.path}...');
  final result = await ocr.recognizeText(OcrSource.file(imageFile));

  print('\n--- RECOGNIZED TEXT ---');
  print(result.text);
  print('-----------------------');

  print('\n--- BOUNDING BOXES ---');
  for (final line in result.lines) {
    print('"${line.text}": ${line.boundingBox}');
  }
  print('-----------------------');
}
1
likes
120
points
147
downloads

Publisher

unverified uploader

Weekly Downloads

A high-performance, local OCR package for Dart and Flutter that leverages native OS APIs.

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

code_assets, ffi, hooks, image, native_toolchain_c, objective_c

More

Packages that depend on platform_ocr