Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/runnerty/executor-puppeteer-export
Runnerty module: Puppeteer wrapper to export html to PDF/image
https://github.com/runnerty/executor-puppeteer-export
executor html-to-image html-to-pdf pdf puppeteer runnerty screenshot
Last synced: 6 days ago
JSON representation
Runnerty module: Puppeteer wrapper to export html to PDF/image
- Host: GitHub
- URL: https://github.com/runnerty/executor-puppeteer-export
- Owner: runnerty
- License: mit
- Created: 2019-06-24T15:50:34.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2023-07-18T22:05:00.000Z (over 1 year ago)
- Last Synced: 2024-12-25T13:17:57.598Z (about 1 month ago)
- Topics: executor, html-to-image, html-to-pdf, pdf, puppeteer, runnerty, screenshot
- Language: JavaScript
- Size: 291 KB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Smart Processes Management
[![NPM version][npm-image]][npm-url] [![Downloads][downloads-image]][npm-url] [![Dependency Status][david-badge]][david-badge-url]
# Puppeteer executor for [Runnerty]:
Puppeteer wrapper to export html to PDF/image with [ejs] template support.
### Installation:
Through NPM
```bash
npm i @runnerty/executor-puppeteer-export
```You can also add modules to your project with [runnerty]
```bash
npx runnerty add @runnerty/executor-puppeteer-export
```This command installs the module in your project, adds example configuration in your [config.json] and creates an example plan of use.
If you have installed [runnerty] globally you can include the module with this command:
```bash
runnerty add @runnerty/executor-puppeteer-export
```### Configuration sample:
Add in [config.json]:
```json
{
"id": "puppeteer_default",
"type": "@runnerty-executor-puppeteer-export"
}
```### Plan sample:
Add in [plan.json]:
```json
{
"id": "puppeteer_default",
"html": "./workspace/templates/template_one.html",
"pdf": {
"path": "sample.pdf",
"format": "a4",
"printBackground": false
}
}
```### Plan advanced:
Add in [plan.json]:
```json
{
"id": "puppeteer_default",
"html": "./workspace/templates/template_one.html",
"launch": {
"headless": false,
"executablePath": "/path/to/Chrome"
},
"authenticate": {
"username": "my_usr_name",
"password": "my_pass"
},
"userAgent": "Runnerty",
"extraHTTPHeaders": {
"my_header": "my_header_value"
},
"bypassCSP": false,
"offlineMode": false,
"cacheEnabled": true,
"javaScriptEnabled": true,
"cookie": {
"name": "string",
"value": "string"
},
"viewport": {
"width": 1024,
"height": 900
},
"geolocation": {
"latitude": 36.6,
"longitude": 2.36
},
"options": {
"waitUntil": "load"
},
"pdf": {
"path": "sample.pdf",
"format": "a4",
"printBackground": true,
"margin": {
"top": "20px",
"left": "20px",
"right": "20px",
"bottom": "20px"
}
},
"screenshot": {
"path": "sample.png",
"type": "png"
},
"args": {
"subject": "Sample plan",
"message": "Value for template one EJS var"
}
}
```[runnerty]: https://www.runnerty.io
[downloads-image]: https://img.shields.io/npm/dm/@runnerty/executor-puppeteer-export.svg
[npm-url]: https://www.npmjs.com/package/@runnerty/executor-puppeteer-export
[npm-image]: https://img.shields.io/npm/v/@runnerty/executor-puppeteer-export.svg
[david-badge]: https://david-dm.org/runnerty/executor-puppeteer-export.svg
[david-badge-url]: https://david-dm.org/runnerty/executor-puppeteer-export
[config.json]: http://docs.runnerty.io/config/
[plan.json]: http://docs.runnerty.io/plan/
[ejs]: https://ejs.co