I'm generating PDF's using the Prawn Gem and I'm unable to find a way to move the cursor
down after text_box
expands from overflow text, similar to the way a regular text
call would.
Text_box example
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
}
So above, I have to pad
and move_down
from the text_box payable
in order for the next set of text_boxes to be formatted correctly without overlapping. If I use a straight text
call on the payable
string then the cursor moves down after all of the text is rendered, as expected.
The reason I'm using text_box
over regular text
is so that I can position text side by side on the same line. While this works great for strings thats all fit on a single line, it doesn't seem to play out well if one of those areas expands the text_box
downwards because the cursor just starts at the next text line instead of below the expanded text_box.
Any insight or suggestions would be appreciated, thanks!