diff --git a/lib/pdf/reader/find_text.rb b/lib/pdf/reader/find_text.rb index 00ebc0e..ea928f9 100644 --- a/lib/pdf/reader/find_text.rb +++ b/lib/pdf/reader/find_text.rb @@ -6,6 +6,8 @@ require_relative "find_text/version" module PDF::Reader::FindText def find_text(text) + text = text.tr(' ', '') + runs(merge: false).each_cons(text.size).select do |r| r.map(&:text).join == text end.map do |r|