fix acroform select field

This commit is contained in:
Alex Turchyn
2024-11-06 19:27:37 +02:00
committed by Pete Matsyburka
parent e9034d8da7
commit 0b0f0b497e
2 changed files with 29 additions and 3 deletions
+9
View File
@@ -122,6 +122,15 @@ module Templates
io = StringIO.new
pdf.acro_form.each_field do |field|
next if field.field_type != :Ch ||
field[:Opt].blank? ||
%i[combo_box editable_combo_box].exclude?(field.concrete_field_type) ||
!field.field_value.to_s.match?(FindAcroFields::SELECT_PLACEHOLDER_REGEXP)
field[:V] = ''
end
pdf.acro_form.create_appearances(force: true) if pdf.acro_form[:NeedAppearances]
pdf.acro_form.flatten