How to get cell height using Prawn & Prawnto?

I am a little stuck in using shrimp / shrimp to create PDF documents. The Prawn documentation has helped some, but currently the Prawnto documentation seems to be disabled.

I am trying to find a way to place text cells based on the previous cell height. Shrimp has methods for this - not a problem, but the return value from working with pdf.cell (even though it generates a cell) is the bounding block of the Prawn - essentially a page.

How can I do something like this below and get the height of the cell, not the bounding box?

offer = pdf.cell [220, 680], :text => @reward.offer, :width => 250, :font_size => 14
pitch = pdf.cell [220, offer.height - 20], :text => offer.height, :width => 250, :font_size => 12
rules = pdf.cell [220, pitch.height - 20], :text => pitch.height, :width => 250, :font_size => 12
+3
source share

Source: https://habr.com/ru/post/1714716/


All Articles