adjust pdf processor

This commit is contained in:
Pete Matsyburka
2024-02-25 17:19:51 +02:00
parent 345fe674d4
commit 608347b1e6
+2 -2
View File
@@ -51,7 +51,7 @@ class PdfProcessor < HexaPDF::Content::Processor
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 @@ class PdfProcessor < HexaPDF::Content::Processor
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|