generateDocument static method

Future<void> generateDocument(
  1. Map document,
  2. Map configuration

Generate a document from a list of scans

It takes a document map with the following values:

  • pages: an array of page objects. Each page object has:
    • imageUrl: the URL of the image file for this page, e.g. file://<filepath>.{jpeg|png}
    • hocrTextLayout: the text layout in hOCR format

It also takes a configuration parameter with the following options:

  • outputFileUrl: the URL where the document should be generated, e.g. file://<filepath>.pdf
  • pdfFontFileUrl: Custom font file used during the PDF generation to embed an invisible text layer. If null, a default font is used, which only supports Latin languages.


static Future<void> generateDocument(Map document, Map configuration) async {
  await _channel.invokeMethod('generateDocument', <String, dynamic>{
      'document': document,
      'configuration': configuration,