I have a simple code to create 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 .
The problem is that this does not automatically create a new page. When the text exceeds the first page, the rest of the text is not displayed at all or these texts are not displayed on the new page.
How to automatically float texts to a new page when it reaches the end of the page?
Update: The problem with my code seems to be with this line :at => [0.5.cm, cursor] , if I delete the position, then it flows to the next page, the same thing happens when I use span. If I use a position with text in a range, then it does not flow to the next page, and if I delete it, it will go to the 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]
Text field or text without cursor positions, I need to use x-position, because each line has different x-positions.
source share