printPDF method
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,
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;
}
}