pdfmake API?是否有样式,字体和功能列表?

ras*_*adb 12 css html5 pdf-generation pdfmake

我正在使用pdfmake.我想格式化一个文档,他们在github和他们的操场上有很好的例子,但我想知道他们是否具有其中的所有功能.我觉得他们可能是其他属性,如切换字体,添加不同的样式元素或下划线 - 在示例中没有明确共享的内容.也许你所看到的就是你得到的东西,但我只是彻底地浏览了github页面并没有找到更详细的功能列表.似乎hella类似于html但它似乎没有相同的html/css样式功能,如果有更多的东西可以有人请指出它.

小智 14

在这里你去..至少,支持下面未注释的样式.我亲自尝试过.

['font',
'fontSize',
'bold',
'italics',
'alignment',
'color',
'columnGap',
'fillColor',
'decoration',
'decorationStyle',
'decorationColor',
'background',
'lineHeight'
//'tableCellPadding'
// 'cellBorder',
// 'headerCellBorder',
// 'oddRowCellBorder',
// 'evenRowCellBorder',
// 'tableBorder'
]
Run Code Online (Sandbox Code Playgroud)

您可以使用以上样式,如下所示.

var dd = {
    content: [
        { 
            text: 'This is a header, using header style', 
            style: 'header' 
        }
    ],
    styles: {
        header: {
            fontSize: 18,
            bold: true,
            background: '#ff1'
        }
    }
}
Run Code Online (Sandbox Code Playgroud)