ofd.js icon indicating copy to clipboard operation
ofd.js copied to clipboard

parseOfdDocument 解析到的 ofd:Template 是个数组,造成 renderPage 方法报错 TypeError: Cannot read properties of undefined (reading 'json')

Open Hughe5 opened this issue 1 year ago • 3 comments

使用 parseOfdDocument 方法解析 ofd 文件,success 返回的数据里 pages[0][47].json["ofd:Template"] 是个数组,不是对象,如下图, image 当 template 是数组时,template['@_TemplateID']]['json'] 会报 TypeError: Cannot read properties of undefined (reading 'json') 的错误,如下图, image

Hughe5 avatar May 31 '24 13:05 Hughe5

@DLTech21 image 存在多个 Template 时会报错

Hughe5 avatar Jun 03 '24 08:06 Hughe5

自行修改

DLTech21 avatar Jun 03 '24 09:06 DLTech21

@DLTech21 大佬,帮忙评审并合入一下 https://github.com/DLTech21/ofd.js/pull/113

Hughe5 avatar Jun 04 '24 03:06 Hughe5