Moleculer service to generate PDF
Features
Install
npm install moleculer-pdf --save
Usage
'use strict'; let ServiceBroker = ;let PDFService = ;const promisify = ;const writeFile = ;const writeFileAsync = ; // Create brokerlet broker = logger: console; // Load my servicebroker; // Start serverbrokerstart;
Settings
Property | Type | Default | Description |
---|---|---|---|
puppeteerArgs |
Object |
{ headless: true } |
Set of configurable options to set on the browser |
options |
Object |
{ format: 'letter' } |
Set of configurable options to set pdf document |
remoteContent |
Boolean |
true |
Content to load on webpage like |
Actions
transform
Transform html to pdf document
Parameters
Property | Type | Default | Description |
---|---|---|---|
html |
String |
required | The html content |
Results
Type: Buffer
- Generated pdf document
Methods
transform
Transform html to pdf document
Parameters
Property | Type | Default | Description |
---|---|---|---|
html |
String |
- | The html content |
Results
Type: Buffer
- Generated pdf document
Test
$ npm test
In development with watching
$ npm run ci
Contribution
Please send pull requests improving the usage and fixing bugs, improving documentation and providing better examples, or providing some testing, because these things are important.
License
The project is available under the MIT license.
Contact
Copyright (c) 2019 moleculer-pdf