gpt4 book ai didi

angularjs - 无法识别的文档结构 : {"style" :"subheader" ,"alignment" :"right" ,"_margin":[0, 20,0,5]}

转载 作者:行者123 更新时间:2023-12-03 22:33:26 27 4
gpt4 key购买 nike

我正在开发一个 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.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有什么问题?
在该按钮上单击两次时,我得到了输出,即 pdf 文件。
我认为错误发生在
content: [
{ image: invoice.AddressTo.icon, style: 'subheader', alignment:'right'},

我错过了什么?
请帮忙...

最佳答案

嗨,我也有这个问题,我猜是因为字符编码,尝试从您的文档中删除地址,看看它是否有效。我通过删除地址解决了这个问题,因为它以西里尔编码保存在我的数据库中。

此致

关于angularjs - 无法识别的文档结构 : {"style" :"subheader" ,"alignment" :"right" ,"_margin":[0, 20,0,5]},我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41263320/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com