Skip to content

Commit

Permalink
fix pdf form fields
Browse files Browse the repository at this point in the history
  • Loading branch information
omohokcoj committed Jul 10, 2024
1 parent e96cb5e commit 12c6957
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/templates/find_acro_fields.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def call(pdf, attachment)
areas = Array.wrap(field[:Kids] || field).filter_map do |child_field|
page = annots_index[child_field.hash]

media_box = page[:MediaBox]
media_box = page[:CropBox] || page[:MediaBox]
crop_box = page[:CropBox] || media_box

media_box_start = [media_box[0], media_box[1]]
Expand Down Expand Up @@ -51,7 +51,7 @@ def call(pdf, attachment)

next if attrs[:w].zero? || attrs[:h].zero?

if child_field[:MaxLen] && child_field.concrete_field_type == :comb_text_field
if child_field[:MaxLen] && child_field.try(:concrete_field_type) == :comb_text_field
attrs[:cell_w] = w / page_width / child_field[:MaxLen].to_f
end

Expand Down

0 comments on commit 12c6957

Please sign in to comment.