我正在使用 Prawn Gem 生成 PDF,但我无法找到移动 PDF 的方法cursor
之后下来text_box
从溢出文本扩展,类似于常规的方式text
打电话会。
文本框示例
pad(5) {
text_box payable, :at => [bounds.left, cursor], :width => 540, :height => 15, :overflow => :expand, inline_format: true
}
move_down(15)
pad(5) {
text_box address, :at => [bounds.left, cursor], :width => 250, :height => 15, :overflow => :expand, inline_format: true
text_box city, :at => [250, cursor], :width => 100, :height => 15, :overflow => :expand, inline_format: true
text_box state, :at => [350, cursor], :width => 75, :height => 15, :overflow => :expand, inline_format: true
text_box zip, :at => [425, cursor], :width => 110, :height => 15, :overflow => :expand, inline_format: true
}
所以上面,我必须pad
and move_down
来自text_box payable
为了使下一组文本框的格式正确且不重叠。如果我用直text
致电payable
string,然后在所有文本都按预期呈现后,光标向下移动。
我使用的原因text_box
超过常规text
以便我可以将文本并排放置在同一行上。虽然这对于所有适合单行的字符串非常有效,但如果其中一个区域扩展了text_box
向下,因为光标只是从下一个文本行开始,而不是在展开的文本框下方。
任何见解或建议将不胜感激,谢谢!