writePDF method

  1. @override
Future<File?> writePDF(
  1. String path,
  2. String fileName,
  3. bool overwrite,
  4. PDFPageFormat pdfPageFormat,
)
override

Implementation

@override
Future<File?> writePDF(String path, String fileName, bool overwrite,
    PDFPageFormat pdfPageFormat) async {
  String? returnPath = await methodChannel.invokeMethod<String>('writePDF', {
    'path': path,
    'fileName': fileName,
    'overwrite': overwrite,
    'pdfPageFormat': pdfPageFormat.index
  });
  if (returnPath != null) {
    return Future<File?>.value(File(returnPath));
  } else {
    return Future<File?>.value(null);
  }
}