1.1.0 • Published 5 years ago

xml2pdf v1.1.0

Weekly downloads
2
License
MIT
Repository
github
Last release
5 years ago

xml2pdf

This repo has been inspired from xml-pdf.

In addition to xml2pdf CLI (see xml-pdf for more info) this lib provides an async function to generate PDF from XML without accessing the filesystem (so that, for instance, it can be used in the browser):

Basic usage

const { xml2pdfAsync } = require('./index');

const xml = '...';
const options = {
    template: '<main template>'
};

xml2pdfAsync(xml, options).then(res => {
    // res is the pdf
}).catch(err => ...));

Header and Footer

const { xml2pdfAsync } = require('./index');

const xml = '...';
const options = {
    template: '...',
    header: {
        height: '10mm', // see html-pdf height options
        template: '<header template>'
    },
    footer: {
        height: '10mm', // see html-pdf height options
        template: '<footer template>'
    }
};

xml2pdfAsync(xml, options).then(res => {
    // res is the pdf
}).catch(err => ...));

See test folder with header and footer examples.

1.1.0

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago