pdfmake API?是否有样式,字体和功能列表? [英] pdfmake API? Is there a list of styles, fonts, capabilities?
问题描述
我正在使用pdfmake。我想格式化一个文档,他们在github和他们的操场上有很好的例子,但我想知道他们是否具有其中的所有功能。我觉得他们可能是其他属性,如切换字体,添加不同的样式元素或下划线 - 在示例中没有明确共享的内容。也许你所看到的就是你得到的东西,但我只是彻底地浏览了github页面并没有找到更详细的功能列表。似乎hella类似于html但它似乎没有相同的html / css样式功能,如果有更多的东西可以有人请指出它。
I'm using pdfmake. I want to format a document and they have good examples on github and in their playground but I was wondering if they featured all capabilities therein. I get the feeling that their may be additional properties like switching fonts, adding different style elements or underlining - things not expressly shared in the examples. Maybe what you see is what you get and that is all but I went over the github page pretty throughly and did not find a more detailed list of capabilities. It seems hella similar to html but it doesn't seem to have the same styling capabilities of html/css, if there is something more could someone please point it out.
推荐答案
这里你去..至少,支持下面未注释的样式。我自己尝试过。
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'
}
}
}
这篇关于pdfmake API?是否有样式,字体和功能列表?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!