createPdf static method
Renders a multi-page PDF document from DOCUMENT images of the given pages
and stores it as a file. For each DOCUMENT image a separate PDF page is generated.
All given pages
must have the DOCUMENT images.
pages
list of pages to render
options
additional options of rendering
return File Uri of the PDF document.
Implementation
static Future<Uri> createPdf(
List<Page> pages, PdfRenderingOptions options) async {
try {
var pagesList = pages.map((page) => page.toJson()).toList();
var arguments = {'pages': pagesList, 'options': options.toJson()};
final uri = await _channel.invokeMethod('createPdf', arguments);
return Uri.parse(uri);
} catch (e) {
Logger.root.severe(e);
rethrow;
}
}