extractText static method

Future<String> extractText({
  1. String? filePath,
  2. Uint8List? bytes,
  3. String? url,
})

Implementation

static Future<String> extractText({String? filePath, Uint8List? bytes, String? url}) async {
  final UEpubBook book = await UEpubBook.open(path: filePath, bytes: bytes, url: url);
  final StringBuffer buffer = StringBuffer();
  for (int i = 0; i < book.chapterCount; i++) {
    buffer.writeln((await book.chapter(i)).text);
  }
  await book.close();
  return buffer.toString();
}