lib/parsers/pdf_parser.rb
def scan_for_attributes(io)
    result = {}

    while read = safe_read(io, 1)
      case read
      when '%'
        break if safe_read(io, EOF_MARKER.size) == EOF_MARKER
      when '/'
        find_page_count(io, result)
      end
    end

    result
  end
# Read ahead bytes until one of % or / is reached.
# A header in a PDF always starts with a /
# The % is to detect the EOF
#
Read ahead bytes until one of % or / is reached.
A header in a PDF always starts with a
The % is to detect the EOF
Read ahead bytes until one of % or / is reached . A header in a PDF always starts with a The % is to detect the EOF
def scan_for_attributes(io)
    result = {}
    while read = safe_read(io, 1)
      case read
      when '%'
        break if safe_read(io, EOF_MARKER.size) == EOF_MARKER
      when '/'
        find_page_count(io, result)
      end
    end
    result
  end
def scan_for_attributes ( io ) result = { } while read = safe_read ( io , 1 ) case read when '%' break if safe_read ( io , EOF_MARKER . size ) == EOF_MARKER when '/' find_page_count ( io , result ) end end result end
Read ahead bytes until one of % or / is reached.
Read ahead bytes until one of % or / is reached .
io