createPDFFromMultipleImages method
Future<String>
createPDFFromMultipleImages({
- required List<
String> inputPaths, - required String outputPath,
- int? maxWidth,
- int? maxHeight,
- 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;
}