react-native-img-to-pdf

1.7.0 • Public • Published

react-native-img-to-pdf

Create a PDF from images in React-Native.

Getting started

$ npm install @star/react-native-img-to-pdf --save

or

$ yarn add @star/react-native-img-to-pdf

Usage

import RNImageToPdf from 'react-native-img-to-pdf';

...
const imgToPDF = async () => {
	try {
		const options = {
			imagePaths: imagePaths: ['/path/to/image1.png','/path/to/image2.png'],
			name: name: 'PDFName',
			maxSize: { // optional maximum image dimension - larger images will be resized
				width: 900,
				height: Math.round(deviceHeight() / deviceWidth() * 900),
			},
			quality: .7, // optional compression paramter
		};
		const pdf = await RNImageToPdf.createPDFbyImages(options);
		
		console.log(pdf.filePath);
	} catch(e) {
		console.log(e);
	}
}

Readme

Keywords

Package Sidebar

Install

npm i react-native-img-to-pdf

Weekly Downloads

0

Version

1.7.0

License

MIT

Unpacked Size

111 kB

Total Files

20

Last publish

Collaborators

  • starinv