Skip to content

Commit 460fc64

Browse files
docs: added readme
1 parent 97e1c75 commit 460fc64

File tree

2 files changed

+56
-10
lines changed

2 files changed

+56
-10
lines changed

IMG/logo.png

153 KB
Loading

README.md

Lines changed: 56 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,79 @@
1-
# react-native-pdf-from-image
1+
<h1 align="center">
2+
<img width="200" height="200" src="./IMG/logo.png"/><br/>
3+
React Native Pdf From Image Library
4+
</h1>
25

3-
Des
6+
Generate PDF documents from an array images.
47

5-
## Installation
8+
## 🌟 Features
9+
10+
- **Image to PDF Conversion**: Effortlessly convert images into PDF documents.
11+
- **Customizable Paper Sizes**: Choose from standard paper sizes or define custom dimensions for your PDFs.
12+
13+
## Old Architecture Support
14+
15+
> [!WARNING]
16+
> react-native-pdf-from-image is a pure C++ TurboModule, and **requires the new architecture to be enabled**.
17+
>
18+
> - Work is ongoing to support the old architecture.
19+
20+
## 🚀 Installation
621

722
```sh
823
npm install react-native-pdf-from-image
924
```
1025

11-
## Usage
26+
or
27+
28+
```sh
29+
yarn add react-native-pdf-from-image
30+
```
31+
32+
```sh
33+
cd ios && pod install
34+
```
1235

36+
## 📖 Usage
37+
38+
Here's a basic example of how to use the library:
1339

1440
```js
15-
import { multiply } from 'react-native-pdf-from-image';
41+
import { createPdf } from 'react-native-pdf-from-image';
1642

17-
// ...
43+
const images = ['path/to/image1.jpg'];
1844

19-
const result = multiply(3, 7);
45+
const { filePath } = createPdf({
46+
imagePaths: images,
47+
name: 'myPdf',
48+
paperSize: 'A4',
49+
customPaperSize: {
50+
height: 300,
51+
width: 300,
52+
},
53+
});
2054
```
2155

56+
## 📦 Props
57+
58+
### createPdf(params)
59+
60+
- params : An object containing the following properties:
61+
- imagePaths (Array of strings): An array of file paths to the images you want to include in the PDF.
62+
- name (string): The name of the PDF file to be created.
63+
- paperSize (string, optional): The size of the paper for the PDF. Common sizes like 'A4' are supported.
64+
- customPaperSize (object, optional): An object specifying custom dimensions for the paper size. It should have height and width properties.
65+
66+
### Returns
67+
68+
- An object containing:
69+
- filePath (string): The file path to the generated PDF document.
2270

2371
## Contributing
2472

2573
See the [contributing guide](CONTRIBUTING.md) to learn how to contribute to the repository and the development workflow.
2674

2775
## License
2876

29-
MIT
77+
This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for more information.
3078

3179
---
32-
33-
Made with [create-react-native-library](https://github.com/callstack/react-native-builder-bob)

0 commit comments

Comments
 (0)