class PDF::Reader::Parser
def hex_string
###############################################################################
def hex_string str = "".dup loop do token = @buffer.token break if token == ">" raise MalformedPDFError, "unterminated hex string" if @buffer.empty? str << token end # add a missing digit if required, as required by the spec str << "0" unless str.size % 2 == 0 str.scan(/../).map {|i| i.hex.chr}.join.force_encoding("binary") end