From 8d7c3f0e260a975792762c4df91b7595529de53c Mon Sep 17 00:00:00 2001 From: Pete Matsyburka Date: Mon, 23 Mar 2026 09:27:12 +0200 Subject: [PATCH] fix generation --- lib/submissions/generate_result_attachments.rb | 5 +++-- lib/templates/build_annotations.rb | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/submissions/generate_result_attachments.rb b/lib/submissions/generate_result_attachments.rb index ab5a840a..b538f6bc 100644 --- a/lib/submissions/generate_result_attachments.rb +++ b/lib/submissions/generate_result_attachments.rb @@ -236,9 +236,10 @@ module Submissions page[:Annots] ||= [] page[:Annots] = page[:Annots].try(:reject) do |e| - next if e.is_a?(Integer) || e.is_a?(Symbol) + next if e.is_a?(Integer) || e.is_a?(Symbol) || e.is_a?(HexaPDF::PDFArray) - e.present? && e[:A] && e[:A][:URI].to_s.starts_with?('file:///docuseal_field') + e.present? && e[:A] && !e[:A].is_a?(HexaPDF::PDFArray) && + e[:A][:URI].to_s.starts_with?('file:///docuseal_field') end || page[:Annots] width = page.box.width diff --git a/lib/templates/build_annotations.rb b/lib/templates/build_annotations.rb index 9a933f99..8ce566d1 100644 --- a/lib/templates/build_annotations.rb +++ b/lib/templates/build_annotations.rb @@ -10,7 +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.is_a?(Integer) || annot.is_a?(Symbol) || annot.is_a?(HexaPDF::PDFArray) 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://')