Using the react-native-pic2pdf library, converting images to PDF produces a ‘null object’ error. Both remote URLs and local paths trigger this issue.
const pics = ['https://example.com/image1.jpg', 'https://example.com/image2.jpg'];
async function assemblePDF() {
try {
const config = { files: pics, outputName: 'Document' };
const pdfResult = await RNPic2Pdf.generatePDF(config);
console.log(pdfResult.location);
} catch (exception) {
console.error(exception);
}
}