https://github.com/benjamineruvieru/react-native-pdf-from-image
Generate PDF documents from an array images.
https://github.com/benjamineruvieru/react-native-pdf-from-image
image-to-pdf pdf-generation pdf-generation-react react-native
Last synced: 4 months ago
JSON representation
Generate PDF documents from an array images.
- Host: GitHub
- URL: https://github.com/benjamineruvieru/react-native-pdf-from-image
- Owner: benjamineruvieru
- License: mit
- Created: 2025-01-29T14:19:04.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2025-01-29T15:00:38.000Z (4 months ago)
- Last Synced: 2025-01-29T15:04:20.070Z (4 months ago)
- Topics: image-to-pdf, pdf-generation, pdf-generation-react, react-native
- Language: Kotlin
- Homepage: https://docs.benjamineruvieru.com/react-native-pdf-from-image
- Size: 0 Bytes
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
React Native Pdf From Image LibraryGenerate PDF documents from an array images.
## 🌟 Features
- **Image to PDF Conversion**: Effortlessly convert images into PDF documents.
- **Customizable Paper Sizes**: Choose from standard paper sizes or define custom dimensions for your PDFs.## Old Architecture Support
~~react-native-pdf-from-image is a pure TurboModule, and **requires the new architecture to be enabled**.~~
~~- Work is ongoing to support the old architecture.~~The library now supports both new and old architecture! 🎉🎉🎉
## 🚀 Installation
```sh
npm install react-native-pdf-from-image
```or
```sh
yarn add react-native-pdf-from-image
``````sh
cd ios && pod install
```## 📖 Usage
Here's a basic example of how to use the library:
```js
import { createPdf } from 'react-native-pdf-from-image';const images = ['path/to/image1.jpg'];
const { filePath } = createPdf({
imagePaths: images,
name: 'myPdf',
paperSize: 'A4',
customPaperSize: {
height: 300,
width: 300,
},
});
```## 📦 Props
### createPdf(params)
- params : An object containing the following properties:
- imagePaths (Array of strings): An array of file paths to the images you want to include in the PDF.
- name (string): The name of the PDF file to be created.
- paperSize (string, optional): The size of the paper for the PDF. Common sizes like 'A4' are supported.
- customPaperSize (object, optional): An object specifying custom dimensions for the paper size. It should have height and width properties.### Returns
- An object containing:
- filePath (string): The file path to the generated PDF document.## Contributing
See the [contributing guide](CONTRIBUTING.md) to learn how to contribute to the repository and the development workflow.
## License
This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for more information.