printPdfFile method

Future<PrinterStatus> printPdfFile(
  1. String filepath,
  2. int pagenum
)

Print the pdf file using print settings set by setPrinterInfo. Available on Android 5.0 or later.

Implementation

Future<PrinterStatus> printPdfFile(String filepath, int pagenum) async {

  var params = {
    "printerId": mPrinterId,
    "printInfo": mPrinterInfo.toMap(),
    "filePath" : filepath,
    "pagenum" : pagenum
  };

  final Map resultMap = await _channel.invokeMethod("printPdfFile", params);
  PrinterStatus status = PrinterStatus.fromMap(resultMap);

  return status;

}