emon_core 0.3.0-preview.8
emon_core: ^0.3.0-preview.8 copied to clipboard
Dart API over the emon C library (PDF and image to semantic HTML/JSON), with engine adapters, model packs and build hooks.
// Convert a PDF or image to HTML with no OCR engine (born-digital PDFs and images with text).
//
// dart run example/main.dart INPUT OUTPUT.html
import 'dart:io';
import 'package:emon_core/emon_core.dart';
Future<void> main(List<String> args) async {
if (args.length != 2) {
stderr.writeln('usage: dart run example/main.dart INPUT OUTPUT.html');
exit(2);
}
final emon = await Emon.open();
try {
final model = await emon.convert(EmonInput.file(args[0]));
File(args[1]).writeAsStringSync(await model.html());
await model.dispose();
} finally {
await emon.close();
}
}