createPDFFromMultipleImages method

  1. @override
Future<String> createPDFFromMultipleImages({
  1. required List<String> inputPaths,
  2. required String outputPath,
  3. int? maxWidth,
  4. int? maxHeight,
  5. bool? needImageCompressor,
})
override

Creates a single PDF from multiple images.

Takes a list of input image file paths and an output path, and returns the path to the generated PDF.

inputPaths - List of paths to the input image files. outputPath - The path where the created PDF will be saved. maxWidth - Optional maximum width of the images in the output PDF (default is 360). maxHeight - Optional maximum height of the images in the output PDF (default is 360). needImageCompressor - Optional flag to indicate whether to compress the images.

Implementation

@override
Future<String> createPDFFromMultipleImages({
  required List<String> inputPaths,
  required String outputPath,
  int? maxWidth,
  int? maxHeight,
  bool? needImageCompressor,
}) async {
  final JSArray<JSString> jsInputPaths = inputPaths.toJSArray();
  final JSString result =
      (await createPdfFromImages(jsInputPaths).toDart) as JSString;
  return result.toDart;
}