# pdf-from-html

> Generate PDF file using an HTML file as input for the body.

Latest version **0.1.2** (published 2020-06-01) · GPL-3.0-only license · 0 weekly downloads

## Install

```sh
npm install pdf-from-html
pnpm add pdf-from-html
yarn add pdf-from-html
bun add pdf-from-html
```

Provides the command `pdf-from-html`.

## 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.1.2 |
| Published | 2020-06-01 |
| First published | 2019-04-13 |
| Weekly downloads | 0 |
| License | GPL-3.0-only |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 41.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | hq20 |
| Maintainers | hq20, obernardovieira |
| Keywords | pdf, html, convertion |

## Links

- npm: https://www.npmjs.com/package/pdf-from-html
- Repository: https://github.com/hq20/pdf-from-html
- Homepage: https://github.com/hq20/pdf-from-html#readme
- Issues: https://github.com/hq20/pdf-from-html/issues
- npm.io page: https://npm.io/package/pdf-from-html

## Alternatives

- [@cantoo/pdf-lib](https://npm.io/package/@cantoo/pdf-lib.md) — 297.9K weekly downloads
- [datatables.net-buttons](https://npm.io/package/datatables.net-buttons.md) — 200.1K weekly downloads
- [@ckeditor/ckeditor5-export-pdf](https://npm.io/package/@ckeditor/ckeditor5-export-pdf.md) — 167.0K weekly downloads
- [scanbot-web-sdk](https://npm.io/package/scanbot-web-sdk.md) — 15.0K weekly downloads
- [@syncfusion/ej2-angular-pdfviewer](https://npm.io/package/@syncfusion/ej2-angular-pdfviewer.md) — 8.8K weekly downloads

## Recent versions

- 0.1.2 (latest) — 2020-06-01
- 0.1.2-beta.3 — 2020-05-07
- 0.1.2-beta.2 — 2020-04-17
- 0.1.2-beta.1 — 2020-01-10
- 0.1.2-beta — 2020-01-09
- 0.1.1 — 2019-08-01
- 0.1.0 — 2019-08-01
- 0.1.0-beta.5 — 2019-07-15
- 0.1.0-beta.4 — 2019-07-11
- 0.1.0-beta.3 — 2019-05-29
- 0.1.0-beta.2 — 2019-04-19
- 0.1.0-beta.1 — 2019-04-15
- 0.1.0-beta.0 — 2019-04-13

## README

<div align="center">
    <div style="width:870px;height:300px;display:flex;margin:auto">
        <img style="" width="300" src="pdf.svg">&emsp;&emsp;&emsp;
        <span style="line-height:300px;font-size:80px">pdf-from-html</span>
    </div>
</div>

> pdf-from-html is a nodejs library to transform an html (possibly from [markdown-it](https://markdown-it.github.io/)) in a PDF.

<div align="center">
    <div>
        <a
            href="https://travis-ci.org/HQ20/pdf-from-html"><img
                src="https://travis-ci.org/HQ20/pdf-from-html.svg?branch=master" /></a>&emsp;
        <a
            href="https://dependabot.com"><img
                src="https://api.dependabot.com/badges/status?host=github&repo=HQ20/pdf-from-html" /></a>&emsp;
    </div>
</div>


## Installation

Install it with npm or yarn.

```bash
$ npm install --dev pdf-from-html
# or
$ yarn add --dev pdf-from-html
```

## Usage

It's possible to use it from command line

```bash
$ pdf-from-html docs/ somefile.html
```
as npm script
```bash
"scripts": {
    "pdf": "pdf-from-html docs/ somefile.html"
},
```
or as part of your nodejs app
```typescript
import { generatePDF } from 'pdf-from-html';
// or
// const generatePDF = require('pdf-from-html').generatePDF;
// and then just call the method
generatePDF(outputDir: string, outputFileName: string, inputContent: string);
```

## Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

## License
[Apache-2.0](LICENSE.md)

## Credits
* Icons made by <a href="https://www.flaticon.com/authors/freepik" title="Freepik">Freepik</a> from <a href="https://www.flaticon.com/" title="Flaticon"> www.flaticon.com</a>

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