pdfmake API? Is there a list of styles, fonts, capabilities?

て烟熏妆下的殇ゞ 提交于 2019-12-03 02:43:51

Here you go.. At least, uncommented below styles are supported. I tried it myself.

['font',
'fontSize',
'bold',
'italics',
'alignment',
'color',
'columnGap',
'fillColor',
'decoration',
'decorationStyle',
'decorationColor',
'background',
'lineHeight'
//'tableCellPadding'
// 'cellBorder',
// 'headerCellBorder',
// 'oddRowCellBorder',
// 'evenRowCellBorder',
// 'tableBorder'
]

You could use the above styles, as below.

var dd = {
    content: [
        { 
            text: 'This is a header, using header style', 
            style: 'header' 
        }
    ],
    styles: {
        header: {
            fontSize: 18,
            bold: true,
            background: '#ff1'
        }
    }
}
Romo

You can use margin also as shown below.

// margin: [left, top, right, bottom]
{ text: 'sample', margin: [ 5, 2, 10, 20 ] },

// margin: [horizontal, vertical]
{ text: 'another text', margin: [5, 2] },

// margin: equalLeftTopRightBottom
{ text: 'last one', margin: 5 }

It is from the docs Here.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!