我已使用SharpVector将SVG图像转换为XAML,后者创建了以下代码:
File "/home/openerp/clean_oe7/server/openerp/report/report_sxw.py", line 442, in create
pdf = create_doc(etree.tostring(processed_rml),rml_parser.localcontext,logo,title.encode('utf8'))
File "/home/openerp/clean_oe7/server/openerp/report/interface.py", line 206, in create_pdf
obj.render()
File "/home/openerp/clean_oe7/server/openerp/report/render/render.py", line 59, in render
self._result = self._render()
File "/home/openerp/clean_oe7/server/openerp/report/render/rml.py", line 41, in _render
return rml2pdf.parseNode(self.rml, self.localcontext, images=self.bin_datas, path=self.path,title=self.title)
File "/home/openerp/clean_oe7/server/openerp/report/render/rml2pdf/trml2pdf.py", line 1032, in parseNode
r.render(fp)
File "/home/openerp/clean_oe7/server/openerp/report/render/rml2pdf/trml2pdf.py", line 328, in render
pt_obj.render(el)
File "/home/openerp/clean_oe7/server/openerp/report/render/rml2pdf/trml2pdf.py", line 1003, in render
fis += r.render(node_story)
File "/home/openerp/clean_oe7/server/openerp/report/render/rml2pdf/trml2pdf.py", line 897, in render
return process_story(node_story)
File "/home/openerp/clean_oe7/server/openerp/report/render/rml2pdf/trml2pdf.py", line 890, in process_story
flow = self._flowable(node)
File "/home/openerp/clean_oe7/server/openerp/report/render/rml2pdf/trml2pdf.py", line 813, in _flowable
return self._table(node)
File "/home/openerp/clean_oe7/server/openerp/report/render/rml2pdf/trml2pdf.py", line 697, in _table
fl = self._flowable(n, extra_style=paraStyle)
File "/home/openerp/clean_oe7/server/openerp/report/render/rml2pdf/trml2pdf.py", line 766, in _flowable
result.append(platypus.Paragraph(i, style, **(utils.attr_get(node, [], {'bulletText':'str'}))))
File "/usr/lib/python2.7/dist-packages/reportlab/platypus/paragraph.py", line 827, in __init__
self._setup(text, style, bulletText, frags, cleanBlockQuotedText)
File "/usr/lib/python2.7/dist-packages/reportlab/platypus/paragraph.py", line 842, in _setup
style, frags, bulletTextFrags = _parser.parse(text,style)
File "/usr/lib/python2.7/dist-packages/reportlab/platypus/paraparser.py", line 1057, in parse
self.close() # force parsing to complete
File "/usr/lib/python2.7/dist-packages/reportlab/lib/xmllib.py", line 521, in close
self.parser.close()
AttributeError: 'NoneType' object has no attribute 'close'
我想要的是搜索属性值为x:Name =“paths”的DrawingGroup标签,然后在<DrawingGroup>
<DrawingGroup x:Name="DrawingLayer">
<DrawingGroup x:Name="Rooms">
<Drawing Group>
..
</DrawingGroup>
..
..
</DrawingGroup>
<DrawingGroup x:Name="Paths">
<GeometryDrawing>
<GeometryDrawing.Pen>
<Pen Brush="#FF0000FF" Thickness="1"StartLineCap="Flat"EndLineCap="Flat" LineJoin="Miter" opacity="1" />
</GeometryDrawing.Pen>
<GeometryDrawing.Geometry>
<LineGeometry StartPoint="378,45" EndPoint="378,98" />
</GeometryDrawing.Geometry>
</GeometryDrawing>
<GeometryDrawing> ..</GeometryDrawing>
</GeometryDrawing> .. </GeometryDrawing>
</DrawingGroup>
中进行更改
我在加载时加载此xaml文件。
我完全对这个文件感到困惑..
答案 0 :(得分:0)
你可以在元素本身上放一个x:Name,不需要搜索DrawingGroup x:Name
<Pen Brush="#FF0000FF" Thickness="1" StartLineCap="Flat" EndLineCap="Flat" LineJoin="Miter" x:Name="Pen1"/>
并从CodeBehind编辑它:
Pen1.Thickness = 100;
编辑:因为你在运行时获得了XAML:
((GeometryDrawing)Paths.Children[0]).Pen.Thickness = 100;