Skip to content

Commit

Permalink
adjust pdf processor
Browse files Browse the repository at this point in the history
  • Loading branch information
omohokcoj committed Feb 25, 2024
1 parent 345fe67 commit 608347b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/pdf_processor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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|
Expand All @@ -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|
Expand Down

0 comments on commit 608347b

Please sign in to comment.