1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
| <!doctype html>
<html lang='en'>
<head>
<meta charset='utf-8'>
<script src='pdfmake.min.js'></script>
<script src='vfs_fonts.js'></script>
<script>
var docDefinition = {
content: [
{ text: 'This is a header', style: 'header' },
'No styling here, this is a standard paragraph',
{ text: 'Another text', style: 'anotherStyle' },
{ text: 'Multiple styles applied', style: [ 'header', 'anotherStyle' ] }
],
styles: {
header: {
fontSize: 22,
bold: true
},
anotherStyle: {
italic: true,
alignment: 'right'
}
}
};
</script>
</head>
<body>
<input type="button" value="Générer le pdf" onclick="pdfMake.createPdf(docDefinition).open();">
</body>
</html> |
Partager