线条未渲染
我正在开发一些虾报告并遇到一个问题,我用如下代码绘制的任何线都只会在最后一页中呈现。
horizontal_line(0, 200, :at => y)
每页调用一次。
我的代码现在相对复杂,所以我尝试隔离问题并发布在这里,隔离的代码如下
require 'prawn'
a = Prawn::Document.new(:page_size => 'A4', :margin => [20,20,20,20])
a.font('Times-Roman')
a.horizontal_line(10, 400, :at => 140)
a.text_box('Test Text', :size => 50, :at => [2, 100], :width => 400)
puts a.render
令我惊讶的是,即使使用单页文档它也不起作用。仅呈现“测试文本”。这让我觉得我在页面设置中做错了什么或类似的事情。
I am developing some prawn reports and running into an issue where any line I draw with a code like the following will render only in the last page.
horizontal_line(0, 200, :at => y)
It is called once per page.
My code is relatively complex now so I tried to isolate the problem to post here, the isolated code follows
require 'prawn'
a = Prawn::Document.new(:page_size => 'A4', :margin => [20,20,20,20])
a.font('Times-Roman')
a.horizontal_line(10, 400, :at => 140)
a.text_box('Test Text', :size => 50, :at => [2, 100], :width => 400)
puts a.render
For my surprise, it didn´t work even with a single page document. Only the "Test Text" is being rendered. It makes me think I am doing something wrong in the page setup or something like that.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
找出问题所在。
正确的用法是:
Fond out the problem.
The correct use would be: