# node-images2pdf

> Package multiple images into a PDF Edit

Latest version **0.0.1** (published 2018-03-17) · MIT license · 0 weekly downloads

## Install

```sh
npm install node-images2pdf
pnpm add node-images2pdf
yarn add node-images2pdf
bun add node-images2pdf
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.1 |
| Published | 2018-03-17 |
| First published | 2018-03-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 343.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Dan Kyung |
| Maintainers | dankyung |

## Links

- npm: https://www.npmjs.com/package/node-images2pdf
- Repository: https://github.com/dank/node-images2pdf
- Homepage: https://github.com/dank/node-images2pdf#readme
- Issues: https://github.com/dank/node-images2pdf/issues
- npm.io page: https://npm.io/package/node-images2pdf

## Dependencies (2)

- [pdfkit](https://npm.io/package/pdfkit.md) ^0.8.3
- [bluebird](https://npm.io/package/bluebird.md) ^3.5.1

## Recent versions

- 0.0.1 (latest) — 2018-03-17

## README

# node-images2pdf
> Package multiple images into a single PDF.

## Installation
    npm install --save node-images2pdf

## Usage

### Initialization

    const Converter = require('node-images2pdf');
    const pdf = new Converter(options);

**Options**

| Name | Description | Type | Default | Optional |
| --- | --- | --- | --- | --- |
| column | Number of images per column | number | | false |
| row | Number of images per row | number | | false |
| margin  | Margin around the page in pixels | number | `72` | true |
| minPaddingX | Minimum padding between images on the horizontal plane | number | `36` | true |
| minPaddingY | Minimum padding between images on the vertical plane | number | `36` | true |
| page.pageSize | Page size [(Refer to this guide)](https://github.com/devongovett/pdfkit/blob/master/docs/paper_sizes.coffee.md) | string | `letter` | true |
| page.layout | Page layout | `portrait`, `landscape` | `portrait` | true |
| image.imgSize | Auto image sizing options | `fit` | `fit`, `stretch` | true |

### Methods

- `convert([images], output)`

Given an array of image paths and the output path this function will generate a PDF output and return a Promise.

## Example

```javascript
const Converter = require('node-images2pdf');

const pdf = new Converter({column: 2, row: 3, margin: 0, page: {pageSize: 'A4'}, image: {imgSize: 'stretch'});

pdf.convert(['./images/img1.png', './images/img1.jpg', './images/img2.png', './images/img3.png', './images/img4.jpg'], './output.pdf')
  .then(console.log)
  .catch(console.error);
```

## License
[MIT](/LICENSE)

---
_Source: https://npm.io/package/node-images2pdf · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
