ofd.js
ofd.js copied to clipboard
parseOfdDocument 解析到的 ofd:Template 是个数组,造成 renderPage 方法报错 TypeError: Cannot read properties of undefined (reading 'json')
使用 parseOfdDocument 方法解析 ofd 文件,success 返回的数据里 pages[0][47].json["ofd:Template"] 是个数组,不是对象,如下图,
当 template 是数组时,
template['@_TemplateID']]['json'] 会报 TypeError: Cannot read properties of undefined (reading 'json') 的错误,如下图,
@DLTech21
存在多个 Template 时会报错
自行修改
@DLTech21 大佬,帮忙评审并合入一下 https://github.com/DLTech21/ofd.js/pull/113