printPDF method
Prints the first page of a PDF file from an absolute file path.
pdfPath – absolute path to the PDF file on the device.
x, y – label origin coordinates.
Implementation
Future<String?> printPDF(
String pdfPath, {
String x = '10',
String y = '10',
}) async {
try {
final String? result = await _channel.invokeMethod('printPDF', {
'pdfPath': pdfPath,
'x': x,
'y': y,
});
return result;
} on PlatformException catch (e) {
throw 'Failed to print PDF: ${e.message}';
}
}