我正在开发一个 Ionic 应用程序,在该应用程序中我使用pdfmake
.
但是,如果它超过一页,我无法显示 pdf ,因为该pageBreak
属性不起作用
文档定义对象:
var documentdefinition = {
content: [
{
text: 'Unordered list',
style: 'header'
},
{
ol: [
'item 1',
'item 2',
'item 3',
]
},
{
text: '\n\nUnordered list with longer lines',
style: 'header',
pageBreak: 'before',
pageOrientation: 'landscape'
},
{
ol: [
'item 1',
'Lorem ipsum dolor sit amet, consectetur ..',
'item 3',
]
},
{
text: '\n\nNested lists',
style: 'header',
pageBreak: 'before',
pageOrientation: 'portrait'
},
{
ol: [
'item 1',
'Lorem ipsum dolor sit amet, consectetur ..',
{
ol: [
'subitem 1',
'subitem 2',
'subitem 3 - Lorem ipsum dolor sit ame...',
'subitem 4',
'subitem 5',
]
},
'item 3\nsecond line of item3',
]
},
],
styles: {
header: {
bold: true,
fontSize: 15
}
},
defaultStyle: {
fontSize: 12,
}
};
由于以上文档定义的结果,只显示如下内容
无序列表
1.项目 1 2.项目 2 3.项目 3
请帮我找到解决方案。