exportAsImageFromFilePath method
Exports the specified page to an image format defined by exportFormat
.
var resultImagePath = await PdftronFlutter.exportAsImage(1, 92, ExportFormat.BMP, "/sdcard/Download/red.pdf");
Returns the absolute path to the resulting image.
pageNumber
is 1-indexed, and the page is taken from the PDF file at the
given filePath
. The image's resolution is determined by the value of
dpi
. exportFormat
is given as one of the ExportFormat constants.
Implementation
Future<String?> exportAsImageFromFilePath(
int? pageNumber, int? dpi, String? exportFormat, String? filePath) {
return _channel
.invokeMethod(Functions.exportAsImageFromFilePath, <String, dynamic>{
Parameters.pageNumber: pageNumber,
Parameters.dpi: dpi,
Parameters.exportFormat: exportFormat,
Parameters.path: filePath
});
}