printPDF method

  1. @override
Future<bool> printPDF(
  1. String pdfPath, {
  2. int commandType = 0,
  3. int printerWidth = 350,
  4. int printerHeight = 350,
  5. int rotation = 0,
  6. double scale = 0.91,
  7. int? startPage,
  8. int? endPage,
  9. String? password,
})
override

Print PDF document.

Implementation

@override
Future<bool> printPDF(
  String pdfPath, {
  int commandType = 0,
  int printerWidth = 350,
  int printerHeight = 350,
  int rotation = 0,
  double scale = 0.91,
  int? startPage,
  int? endPage,
  String? password,
}) async {
  //print('📑 Flutter: printPDF() called');
  _checkInitialization();
  try {
    return await methodChannel.invokeMethod('printPDF', {
      'pdfPath': pdfPath,
      'commandType': commandType,
      'printerWidth': printerWidth,
      'printerHeight': printerHeight,
      'rotation': rotation,
      'scale': scale,
      if (startPage != null) 'startPage': startPage,
      if (endPage != null) 'endPage': endPage,
      if (password != null) 'password': password,
    });
  } catch (e) {
    rethrow;
  }
}