Image to PDF in React Native
Nutrient React Native SDK enables you to create a PDF document from a single image or a series of images. You can provide configuration options and a name for the new PDF document:
const globalPath = getMainBundlePath(exampleImagePath.toString());const configuration = { name: 'newDocument.pdf', images: [ { imageUri: Platform.OS === 'ios' ? globalPath : exampleImagePath, position: 'center', }, ], override: true,};
try { const { fileURL } = await Processor.generatePDFFromImages(configuration);} catch (error) { console.log(error);}For more information on customizing your document, see the list of all configuration options you can use with Processor.