1.0.5 • Published 3 years ago

jsreport-html-to-pdfmake v1.0.5

Weekly downloads
2
License
MIT
Repository
gitlab
Last release
3 years ago

jsreport-html-to-pdfmake

It is custom receipe for jsreport-core to genereate docx from html template. Based on html-to-pdfmake

Usage

const jsreport = require('jsreport-core')();
const handlebars = require('jsreport-handlebars');
const htmlPdfmake = require('jsreport-html-to-pdfmake');

const fs = require('fs')

async function render(text){
    await jsreport.init();
    jsreport.use(handlebars);
    jsreport.use(htmlPdfmake)

    const pdf = await jsreport.render({
        template: {
            content: text,
            engine: 'handlebars',
            recipe: 'html-to-pdfmake',
        },
        data: {
            test: 'test2'
        }
    });

    return pdf
}

render('<div><h1><span data-type="highlight" style="background-color: #ffff00;"><strong>{{test}}</strong></span></h1></div>')
    .then(res => fs.writeFileSync('./temp.pdf', res.content))
1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago