def graphic_state(graphic_state_dictionary = {})
      # if the graphic state exists, return it's name
      resources[:ExtGState] ||= {}
      gs_res = resources[:ExtGState][:referenced_object] || resources[:ExtGState]
      gs_res.each do |k, v|
        return k if v.is_a?(Hash) && v == graphic_state_dictionary
      end
      # set graphic state type
      graphic_state_dictionary[:Type] = :ExtGState
      # set a secure name for the graphic state
      name = SecureRandom.hex(9).to_sym
      # add object to reasource
      gs_res[name] = graphic_state_dictionary
      # return name
      name
    end
def graphic_state(graphic_state_dictionary = {})
      # if the graphic state exists, return it's name
      resources[:ExtGState] ||= {}
      gs_res = resources[:ExtGState][:referenced_object] || resources[:ExtGState]
      gs_res.each do |k, v|
        return k if v.is_a?(Hash) && v == graphic_state_dictionary
      end
      # set graphic state type
      graphic_state_dictionary[:Type] = :ExtGState
      # set a secure name for the graphic state
      name = SecureRandom.hex(9).to_sym
      # add object to reasource
      gs_res[name] = graphic_state_dictionary
      # return name
      name
    end
register or get a registered graphic state dictionary.
 the method returns the name of the graphos state, for use in a content stream.