https://github.com/lula/xml2pdf
xml-pdf
https://github.com/lula/xml2pdf
Last synced: 5 months ago
JSON representation
xml-pdf
- Host: GitHub
- URL: https://github.com/lula/xml2pdf
- Owner: lula
- License: mit
- Created: 2019-05-21T08:15:50.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2022-12-09T03:21:36.000Z (over 3 years ago)
- Last Synced: 2025-10-04T16:55:25.100Z (9 months ago)
- Language: JavaScript
- Size: 94.7 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# xml2pdf
This repo has been inspired from [xml-pdf](https://gitlab.com/poster983/XML-PDF).
## Basic usage
```language=javascript
const { xml2pdfAsync } = require('./index');
const xml = '...';
const options = {
template: ''
};
xml2pdfAsync(xml, options).then(res => {
// res is the pdf
}).catch(err => ...));
```
## Header and Footer
```language=javascript
const { xml2pdfAsync } = require('./index');
const xml = '...';
const options = {
template: '...',
header: {
height: '10mm', // see html-pdf height options
template: ''
},
footer: {
height: '10mm', // see html-pdf height options
template: ''
}
};
xml2pdfAsync(xml, options).then(res => {
// res is the pdf
}).catch(err => ...));
```
See `test` folder with header and footer examples.