Pdfmake: Margins in defaultStyle

Created on 5 Jul 2018  路  2Comments  路  Source: bpampuch/pdfmake

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] }

bug feature request

All 2 comments

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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

svenyonson picture svenyonson  路  3Comments

Christian24 picture Christian24  路  3Comments

MathLavallee picture MathLavallee  路  3Comments

imoum007 picture imoum007  路  3Comments

kumarandena picture kumarandena  路  3Comments