关于利用trml2pdf生成PDF出现【flowable not yet implemented】错误的原因
来源:互联网 发布:sql partition by用法 编辑:程序博客网 时间:2024/06/08 07:11
最近一直在研究利用RML制作PDF,中间一直遇到各种flowable not yet implemented的错误,郁闷球坏了,今天在去trml2pdf.py源码中查看,发现trml2pdf.py对很对RML标签并没有解析:
def _flowable(self, node):if node.localName=='para':style = self.styles.para_style_get(node)return platypus.Paragraph(self._textual(node), style, **(utils.attr_get(node, [], {'bulletText':'str'})))elif node.localName=='name':self.styles.names[ node.getAttribute('id')] = node.getAttribute('value')return Noneelif node.localName=='xpre':style = self.styles.para_style_get(node)return platypus.XPreformatted(self._textual(node), style, **(utils.attr_get(node, [], {'bulletText':'str','dedent':'int','frags':'int'})))elif node.localName=='pre':style = self.styles.para_style_get(node)return platypus.Preformatted(self._textual(node), style, **(utils.attr_get(node, [], {'bulletText':'str','dedent':'int'})))elif node.localName=='illustration':return self._illustration(node)elif node.localName=='blockTable':return self._table(node)elif node.localName=='title':styles = reportlab.lib.styles.getSampleStyleSheet()style = styles['Title']return platypus.Paragraph(self._textual(node), style, **(utils.attr_get(node, [], {'bulletText':'str'})))elif node.localName=='h1':styles = reportlab.lib.styles.getSampleStyleSheet()style = styles['Heading1']return platypus.Paragraph(self._textual(node), style, **(utils.attr_get(node, [], {'bulletText':'str'})))elif node.localName=='h2':styles = reportlab.lib.styles.getSampleStyleSheet()style = styles['Heading2']return platypus.Paragraph(self._textual(node), style, **(utils.attr_get(node, [], {'bulletText':'str'})))elif node.localName=='h3':styles = reportlab.lib.styles.getSampleStyleSheet()style = styles['Heading3']return platypus.Paragraph(self._textual(node), style, **(utils.attr_get(node, [], {'bulletText':'str'})))elif node.localName=='image':return platypus.Image(node.getAttribute('file'), mask=(250,255,250,255,250,255), **(utils.attr_get(node, ['width','height'])))elif node.localName=='spacer':if node.hasAttribute('width'):width = utils.unit_get(node.getAttribute('width'))else:width = utils.unit_get('1cm')length = utils.unit_get(node.getAttribute('length'))return platypus.Spacer(width=width, height=length)elif node.localName=='pageBreak':return platypus.PageBreak()elif node.localName=='condPageBreak':return platypus.CondPageBreak(**(utils.attr_get(node, ['height'])))elif node.localName=='setNextTemplate':return platypus.NextPageTemplate(str(node.getAttribute('name')))elif node.localName=='nextFrame':return platypus.CondPageBreak(1000) # TODO: change the 1000 !else:sys.stderr.write('Warning: flowable not yet implemented: %s !\n' % (node.localName,))return None在这段代码中查找<nextPage/>、<outlineAdd>、<storePlace>......这些标签都没有,
现在解决的方法就是,换用reportlab api直接写或者修改trml2pdf.py的源码来解析无法识别的一些标签
好吧,我现在也不纠结了,如果哪位大神有比较全面的rml转pdf的工具,希望传给小弟一份 邮箱:513614549@qq.com
0 0
- 关于利用trml2pdf生成PDF出现【flowable not yet implemented】错误的原因
- java.lang.AssertionError: Not yet implemented
- verilog编译问题:SystemVerilog construct not yet implemented: nested module
- email:java.lang.UnsupportedOperationException: Method not yet implemented
- svn "501 Method Not Implemented" 错误的解决
- deeplearn.js API用例(二)softmax的手动实现(解决Softmax backprop is not yet implemented问题)
- 关于java的Graphics出现“Exception in thread "AWT-EventQueue-0" java.lang.UnsupportedOperationException: Not supported yet.”
- 生成圆角,使用curvycorners.js出现错误"No object with ID #calpopup exists yet"的解决
- 关于支付宝接口出现的ILLEGAL_ARGUMENT错误原因
- 关于DB2出现的登录错误及原因
- 关于ORACLE出现ORA-00904标识符错误的问题原因
- 关于VC出现 0x0C150002 错误的原因以及解决方案
- ubuntu更新后出现grub-efi-amd64 not configure yet错误
- gdbserver 调试ARM 上的程序出现“ waitpid:Function not implemented ”问题的解决
- VBoxManage.exe: error: Resize hard disk operation for this format is not implemented yet!
- ajax出现错误的原因
- ORA-08002: sequence SEQ_PREPAY.CURRVAL is not yet defined in this session的原因
- Lvmetad is not active yet错误处理
- Java-day05集合
- Spring学习
- usaco subset
- git命令之git tag 给当前分支打标签
- usaco transform
- 关于利用trml2pdf生成PDF出现【flowable not yet implemented】错误的原因
- webstorm:修改为黑色背景 好看的webstorm主题
- Tomcat7中开启gzip压缩功能的配置方法
- c++ 迭代器
- HDU 2955 Robberies 【01背包】
- narnia8
- usaco wormhole
- VLC-开源播放器编译
- java中abstract详解