mergeMultiplePDFs method

  1. @override
Future<String?> mergeMultiplePDFs({
  1. required List<MergeInput> inputs,
  2. required String outputPath,
})
override

Merges multiple PDF files into a single PDF.

This method sends a request to the native platform to merge the PDF files specified in the inputs parameter and saves the result in the outputPath.

Parameters:

  • inputs: A list of MergeInput objects representing the PDFs to be merged.
  • outputPath: The directory path where the merged PDF should be saved.

Returns:

  • A Future<String?> representing the result of the operation. If the operation is successful, it returns a string message from the native platform; otherwise, it returns null.

Implementation

@override
Future<String?> mergeMultiplePDFs({
  required List<MergeInput> inputs,
  required String outputPath,
}) async {
  final inputPaths = inputs.map((input) => input.path).toList();
  final result = await methodChannel.invokeMethod<String>(
    'mergeMultiplePDF',
    {'paths': inputPaths, 'outputDirPath': outputPath},
  );
  return result;
}