Socket
Socket
Sign inDemoInstall

react-native-images-pdf

Package Overview
Dependencies
0
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    react-native-images-pdf

Easily generate PDF files from images in React Native.


Version published
Weekly downloads
1
decreased by-83.33%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

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.

iOSAndroid

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

Keywords

FAQs

Last updated on 07 Mar 2023

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc