Angularjs 无法识别的文档结构:{“样式”:“副标题”、“对齐”:“右”、“U边距”:[0,20,0,5]}
我正在开发一个android应用程序,使用cordova ionic lab的pdf make插件将应用程序中输入的详细信息转换为pdf。 单击“创建”按钮时出现以下错误Angularjs 无法识别的文档结构:{“样式”:“副标题”、“对齐”:“右”、“U边距”:[0,20,0,5]},angularjs,json,ionic-framework,cordova-plugins,pdfmake,Angularjs,Json,Ionic Framework,Cordova Plugins,Pdfmake,我正在开发一个android应用程序,使用cordova ionic lab的pdf make插件将应用程序中输入的详细信息转换为pdf。 单击“创建”按钮时出现以下错误 Unrecognized document structure: {"style":"subheader","alignment":"right","_margin":[0,20,0,5]} json代码是 var dd = { content: [ { image: invoice.
Unrecognized document structure: {"style":"subheader","alignment":"right","_margin":[0,20,0,5]}
json代码是
var dd = {
content: [
{ image: invoice.AddressTo.icon, style: 'subheader', alignment:'right'},
{ text: 'Service Order:' + invoice.AddressFrom.ServiceOrder, style: 'header', alignment: 'center' },
{ text: 'Customer Name:' + invoice.AddressFrom.CustomerName + ' '
+ 'Asset:' + invoice.AddressFrom.Asset },
{ text: 'Address:' + invoice.AddressFrom.Address },
{ text: ' '},
{
table:
{widths: ['*', '*', '*'],
body: [
[{text: 'Service Item'},{text: 'Status'},{text: 'Remarks'},],
[{text: invoice.AddressTo.s}, {text: invoice.AddressTo.c}, {text: invoice.AddressTo.r1},],
[{text: invoice.AddressTo.s2}, {text: invoice.AddressTo.c2}, {text: invoice.AddressTo.r2},],
[{text: invoice.AddressTo.s3}, {text: invoice.AddressTo.c3}, {text: invoice.AddressTo.r3},],
[{text: invoice.AddressTo.s4}, {text: invoice.AddressTo.c4}, {text: invoice.AddressTo.r4},],
[{text: invoice.AddressTo.s5}, {text: invoice.AddressTo.c5}, {text: invoice.AddressTo.r5},],
[{text: invoice.AddressTo.s6}, {text: invoice.AddressTo.c6}, {text: invoice.AddressTo.r6},],
]
}
// {
// body:[ [{text: 'Service Item' + ' '
// +'Status' + ' '
// + 'Remarks', style: 'subheader'}]]
},
{text:' '},
{text:' '},
{text:' '},
{text:' '},
{ text: 'Customer Feedback:' + invoice.AddressTo.CF, alignment: 'left' },
{text:'Customer Signature: ', style: 'subheader'},
{image: invoice.AddressTo.signc},
// { text: 'Engineer\'s Signature:'},
{text:'Engineer Signature: ', style: 'subheader'},
{image: invoice.AddressTo.signe},
// { text: 'Engineer\'s Signature:' + invoice.AddressTo.ES, alignment: 'left' },
{ text: 'Date:' + invoice.Date, alignment: 'right' },
],
styles: {
header: {
fontSize: 20,
bold: true,
margin: [0, 0, 0, 10],
alignment: 'right'
},
subheader: {
fontSize: 16,
bold: true,
margin: [0, 20, 0, 5]
},
itemsTable: {
margin: [0, 0, 0, 0]
},
itemsTableHeader: {
bold: true,
fontSize: 13,
color: 'black',
},
totalsTable: {
bold: true,
margin: [0, 0, 0, 0]
}
},
defaultStyle: {
}
}
return dd;
这个json有什么问题?
我得到的输出ie,pdf文件时,点击两次该按钮。
我认为错误正在发生
content: [
{ image: invoice.AddressTo.icon, style: 'subheader', alignment:'right'},
我错过了什么?
请帮助…您好,我也遇到了这个问题,我想这是因为字符编码,请尝试从您的文档中删除地址,看看它是否有效。我通过删除地址解决了这个问题,因为它以西里尔语编码保存在我的数据库中
致以最诚挚的问候您是否可以尝试使用
图像:'+invoice.AddressTo.icon
而不是图像:invoice.AddressTo.icon
?我尝试了以下错误类型错误:无法读取DocMeasure.measuremage(pdfmake.js:67692)中未定义的ImageMeasure.measuremage(pdfmake.js:15773)的属性“嵌入”在pdfmake.js:15671