add extra small field font size

This commit is contained in:
Pete Matsyburka
2024-03-20 16:52:47 +02:00
parent 432f290633
commit dec33b4331
2 changed files with 14 additions and 0 deletions
@@ -209,6 +209,16 @@ module Submissions
box_height = lines.sum(&:height)
end
if box_height > (area['h'] * height) + 1
text = HexaPDF::Layout::TextFragment.create(value,
font: pdf.fonts.add(FONT_NAME),
font_size: (font_size / 1.9).to_i)
lines = layouter.fit([text], field['type'].in?(%w[date number]) ? width : area['w'] * width, height).lines
box_height = lines.sum(&:height)
end
height_diff = [0, box_height - (area['h'] * height)].max
right_align_x_adjustment =