createPDFFromMultipleImages static method
Future<String?>
createPDFFromMultipleImages({
- required List<
String> inputPaths, - required String outputPath,
- required PdfFromMultipleImageConfig config,
Creates a PDF from multiple images in a separate isolate.
This method spawns an isolate (or uses compute
on the web) to process
the PDF creation asynchronously.
inputPaths
: A list of file paths of the input images.outputPath
: The file path where the generated PDF will be saved.config
: Configuration settings for PDF generation.
Returns the path of the generated PDF, or null
if an error occurs.
Implementation
static Future<String?> createPDFFromMultipleImages({
required List<String> inputPaths,
required String outputPath,
required PdfFromMultipleImageConfig config,
}) async {
if (PdfCombiner.isMock) {
return await PdfCombinerPlatform.instance.createPDFFromMultipleImages(
inputPaths: inputPaths,
outputPath: outputPath,
config: config,
);
}
return await compute(_pdfFromMultipleImages, {
'inputPaths': inputPaths,
'outputPath': outputPath,
'config': config,
'token': kIsWeb ? null : RootIsolateToken.instance!,
});
}