Im using prawn to create pdfs that contain much data in table format and some lists. The problem with the lists is that Im just using text as lists because there is no semantic
An excellent solution that respects the cursor position as well as render like a true list with a small number of lines of code is:
items = ["first","second","third"]
def bullet_list(items)
start_new_page if cursor < 50
items.each do |item|
text_box "•", at: [13, cursor]
indent(30) do
text item
end
end
end
The start_new_page clause covers scenarios where the bullet line item may need to go onto the next page. This maintains keeping the bullet with the bullet content.
Example PDF Rendering Screenshot: