https://github.com/hq20/pdf-from-html
Transform an HTML file in a PDF file
https://github.com/hq20/pdf-from-html
html pdf pdf-generation render transform
Last synced: 7 months ago
JSON representation
Transform an HTML file in a PDF file
- Host: GitHub
- URL: https://github.com/hq20/pdf-from-html
- Owner: HQ20
- License: gpl-3.0
- Created: 2019-04-13T18:40:54.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2020-06-17T09:15:42.000Z (about 6 years ago)
- Last Synced: 2025-03-18T11:15:20.480Z (over 1 year ago)
- Topics: html, pdf, pdf-generation, render, transform
- Language: HTML
- Homepage:
- Size: 196 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
pdf-from-html
> pdf-from-html is a nodejs library to transform an html (possibly from [markdown-it](https://markdown-it.github.io/)) in a PDF.
## 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 Freepik from www.flaticon.com