<% (0..(area['w'] / area['cell_w']).ceil).each do |index| %>
<% if value[index] %>
<%= value[index] %>
diff --git a/lib/submissions/generate_result_attachments.rb b/lib/submissions/generate_result_attachments.rb
index dd5a231a..72eeb9f1 100644
--- a/lib/submissions/generate_result_attachments.rb
+++ b/lib/submissions/generate_result_attachments.rb
@@ -200,7 +200,9 @@ module Submissions
def fill_submitter_fields(submitter, account, pdfs_index, with_signature_id:, is_flatten:, with_headings: nil,
with_submitter_timezone: false, with_signature_id_reason: true, with_file_links: nil)
- cell_layouter = HexaPDF::Layout::TextLayouter.new(text_valign: :center, text_align: :center)
+ cell_layouters = Hash.new do |hash, valign|
+ hash[valign] = HexaPDF::Layout::TextLayouter.new(text_valign: valign.to_sym, text_align: :center)
+ end
attachments_data_cache = {}
@@ -550,6 +552,8 @@ module Submissions
)
when ->(type) { type == 'cells' && !area['cell_w'].to_f.zero? }
cell_width = area['cell_w'] * width
+ cell_valign = field.dig('preferences', 'valign').to_s.presence || 'center'
+ cell_layouter = cell_layouters[cell_valign]
if (mask = field.dig('preferences', 'mask').presence)
value = TextUtils.mask_value(value, mask)