I have tried to define a margin using the defaultStyle attribute, but it doesn't apply to the document. I also have put others attributes like alignment and fontSize, it worked just fine, it's just the margin that isn't applied.
The code:
defaultStyle:
{
font: 'Garamond',
fontSize: 12,
alignment: 'justify',
margin: [0, 20]
}
Same experience, is a bug or expected behaviour?
Optimally it would be possible to define default styles each type like text, table, columns etc. This would significantly reduce amount of styles that need to be applied manually and enhancing consistency across the document (or even multiple documents)
var dd = {
content: [
{
text:'\t\t\t\t\tSAMPLE TEXT\t\t\t\t\t',
bold: true,
fontSize: 16,
background: 'black',
color: 'white',
widhth:120,
alignment:'center',
margin:[0,180,0],
},
]
}
//try this