I have a formatted_text_box that contains dynamic text. It seems like the box just expands nicely when not given specific dimensions.
The problem is it doesn't seem to move the cursor to the bottom of the box so my text overlaps with the text in the formatted_text_box.
If I could determine the height of the text box I could use move_down accordingly.
Is there any way to determine the height of a text_box on the page?
Expanding on Abraham's stubbed answer:
create the formatted text box, making sure to pass in options you normally pass to the helper method pdf.formatted_text_box
features_box = ::Prawn::Text::Formatted::Box.new(feature_text.flatten, {
at: [@pdf.bounds.left + 3.in, @pdf.bounds.top - 0.7.in],
inline_format: true,
document: @pdf
}
)
dry_run the box features_box.render(dry_run: true)
grab the box height @height = features_box.height
features_box.render
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With