From 608347b1e63f8ba77ab6b93bed9ddac0f3c65c60 Mon Sep 17 00:00:00 2001 From: Pete Matsyburka Date: Sun, 25 Feb 2024 17:19:51 +0200 Subject: [PATCH] adjust pdf processor --- lib/pdf_processor.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/pdf_processor.rb b/lib/pdf_processor.rb index 2c4851321..3e08768ae 100644 --- a/lib/pdf_processor.rb +++ b/lib/pdf_processor.rb @@ -51,7 +51,7 @@ def process(operator, operands = []) handler.call(self, operator, operands) end - def self.call(data, process_handler, result_handler, acc = {}) + def self.call(data, process_handler, result_handler, acc = {}, remove_tags: true) doc = HexaPDF::Document.new(io: StringIO.new(data)) doc.pages.each do |page| @@ -67,7 +67,7 @@ def self.call(data, process_handler, result_handler, acc = {}) page.process_contents(processor) - page.contents = process_handler_instance.contents + page.contents = process_handler_instance.contents if process_handler_instance.result.present? && remove_tags end page[:Annots].to_a.each do |annot|