From aeea61905993910f20526db98b48aef069860a4a Mon Sep 17 00:00:00 2001 From: Pete Matsyburka Date: Fri, 5 Sep 2025 15:29:17 +0300 Subject: [PATCH] skip annotation --- lib/submissions/generate_result_attachments.rb | 2 +- lib/templates/build_annotations.rb | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/submissions/generate_result_attachments.rb b/lib/submissions/generate_result_attachments.rb index 4cad84bf..ae85f346 100644 --- a/lib/submissions/generate_result_attachments.rb +++ b/lib/submissions/generate_result_attachments.rb @@ -226,7 +226,7 @@ module Submissions page[:Annots] ||= [] page[:Annots] = page[:Annots].try(:reject) do |e| - next if e.is_a?(Integer) + next if e.is_a?(Integer) || e.is_a?(Symbol) e.present? && e[:A] && e[:A][:URI].to_s.starts_with?('file:///docuseal_field') end || page[:Annots] diff --git a/lib/templates/build_annotations.rb b/lib/templates/build_annotations.rb index b654198b..9a933f99 100644 --- a/lib/templates/build_annotations.rb +++ b/lib/templates/build_annotations.rb @@ -10,6 +10,7 @@ module Templates pdf.pages.flat_map.with_index do |page, index| (page[:Annots] || []).filter_map do |annot| next if annot.blank? + next if annot.is_a?(Integer) || annot.is_a?(Symbol) next if annot[:A].blank? || annot[:A][:URI].blank? next unless annot[:Subtype] == :Link next if !annot[:A][:URI].starts_with?('https://') && !annot[:A][:URI].starts_with?('http://')