Skip to content

lula/xml2pdf

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

xml2pdf

This repo has been inspired from xml-pdf.

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.

Releases

No releases published

Packages

No packages published