# @siliconminds/pdf

> pdf generator

Latest version **1.0.0** (published 2021-11-02) · ISC license · 0 weekly downloads

## Install

```sh
npm install @siliconminds/pdf
pnpm add @siliconminds/pdf
yarn add @siliconminds/pdf
bun add @siliconminds/pdf
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2021-11-02 |
| First published | 2021-11-02 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 3.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | seppe van besauw |
| Maintainers | sevbesau |

## Links

- npm: https://www.npmjs.com/package/@siliconminds/pdf
- Repository: https://github.com/sevbesau/packages
- Homepage: https://github.com/sevbesau/packages#readme
- Issues: https://github.com/sevbesau/packages/issues
- npm.io page: https://npm.io/package/@siliconminds/pdf

## Dependencies (3)

- [ejs](https://npm.io/package/ejs.md) ^3.1.6
- [html-pdf-node](https://npm.io/package/html-pdf-node.md) ^1.0.7
- [@siliconminds/id](https://npm.io/package/@siliconminds/id.md) ^1.0.1

## Recent versions

- 1.0.0 (latest) — 2021-11-02

## README

# EMAIL
EJS template based pdf generator

## Installation
```console
$ npm install @siliconminds/pdf
```

## Example usage
*'./templates/example.pdf'*

```html
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
  </head>
  <body>
    <h1>Hello <%= name %></h1>
  </body>
</html>
```

```javascript
const pdf = require('@siliconminds/pdf');

// load the templates in the templates dir
pdf.templates.scanDir('./templates');
// generate the example pdf
pdf.generate('expample', { name: 'world' }, '/path/to/generated/pdf')
   .then(id => console.log('generated pdf with id', id));
```

## Template format
Templates are generated using ejs, so see [ejs docs](https://ejs.co/#docs) for more information

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