I have following simple code to generate a pdf.
def employe_details
y = cursor
bounding_box([0, y], :width => 16.cm) do
@employe.each do |pr|
txt = pr.week.to_s + ' '
txt += "work hours"
text_box txt, size: 11, :at => [0.5.cm, cursor]
move_down 0.4.cm
end
.#more similar texts
.
.
end
Problem is, this doesn't create a new page automatically. When the text exceeds first page, rest of the text doesn't show at all or those texts does not show up in a new page.
How to float the texts automatically to a new page when it reaches the end of a page?
Update:
Problem with my code seems with this line :at => [0.5.cm, cursor]
, if I remove the position then it flows to next page, same happens when I use span. If I use position with text in span then it does not flow to next page and if I remove it then it flows to next page. So how can I use something like this
text_box txt, size: 11, :at => [0.5.cm]
text txt, size: 11, :at => [0.5.cm]
Textbox or text without cursor positions, I need to use x-position because every line has different x-positions.