protected function  o_extGState($id,  $action,  $options = "") {
    static  $valid_params =  array("LW",  "LC",  "LC",  "LJ",  "ML",
                                   "D",  "RI",  "OP",  "op",  "OPM",
                                   "Font",  "BG",  "BG2",  "UCR",
                                   "TR",  "TR2",  "HT",  "FL",
                                   "SM",  "SA",  "BM",  "SMask",
                                   "CA",  "ca",  "AIS",  "TK");

    if  ($action !==  "new") {
      $o = & $this->objects[$id];
    }

    switch  ($action) {
    case  "new":
      $this->objects[$id] =  array('t' => 'extGState',  'info' => $options);

      // Tell the pages about the new resource
      $this->numStates++;
      $this->o_pages($this->currentNode,  'extGState',  array("objNum" => $id,  "stateNum" => $this->numStates));
      break;

    case  "out":
      $res = "\n$id 0 obj\n<< /Type /ExtGState\n";

      foreach ($o["info"] as  $k => $v) {
        if  ( !in_array($k, $valid_params))
          continue;
        $res.=  "/$k $v\n";
      }

      $res.= ">>\nendobj";
      return  $res;
    }
  }