0.0.3 • Published 2 years ago

react-native-images-pdf v0.0.3

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

react-native-images-pdf

badge

Easily generate PDF files from images in React Native.

Installation

yarn add react-native-images-pdf

iOS

Run pod install in the ios directory.

Usage

import { createPdf } from 'react-native-images-pdf';

const options = {
  imagePaths: ['/path/to/image1.jpg', '/path/to/image2.jpg'],
  outputDirectory: '/path/to/output',
  outputFilename: 'output.pdf',
};

createPdf(options)
  .then((path) => console.log(`PDF created successfully: ${path}`))
  .catch((error) => console.log(`Failed to create PDF: ${error}`));

API

createPdf(options: CreatePdfOptions) => Promise<string>

Returns a Promise that resolves to a string representing the output path of the generated PDF file.

CreatePdfOptions

OptionTypeDescription
imagePathsstring[]An array of paths to the images that should be included in the PDF. Images will be added to the PDF in the order specified.
outputDirectorystringThe path to the directory where the output PDF file should be saved.
outputFilenamestringThe name of the output PDF file.

Example

Check the example folder for a usage demo.

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT


Made with create-react-native-library

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago

0.1.0

2 years ago