Document to PDF in React Native

PSPDFKit for React Native enables you to create a PDF document from specific pages of existing PDF documents. You can provide configuration options, the path to the output location of the new PDF, and the paths and page indexes to be used as input:

const configuration = {
    filePath: outputPath,
    name: 'newDocument.pdf',
    documents: [
      {
        documentPath: exampleDocumentPath1,
        pageIndex: 5,
      },
      {
        documentPath: exampleDocumentPath2,
        pageIndex: 8,
      },
    ],
    override: true,
  };
try {
    const { fileURL } = await Processor.generatePDFFromDocuments(configuration);
    // Do something with the new file by accessing it from the `fileURL` path.
} catch (error) {
    console.log(error);
}

For more information on customizing your document, see the list of all configuration options you can use with Processor.