protected function  o_annotation($id, $action, $options = '') {
    if  ($action !== 'new') {
      $o = & $this->objects[$id];
    }

    switch  ($action) {
    case  'new':
      // add the annotation to the current page
      $pageId =  $this->currentPage;
      $this->o_page($pageId, 'annot', $id);

      // and add the action object which is going to be required
      switch ($options['type']) {
      case  'link':
        $this->objects[$id] = array('t'=>'annotation', 'info'=>$options);
        $this->numObj++;
        $this->o_action($this->numObj, 'new', $options['url']);
        $this->objects[$id]['info']['actionId'] = $this->numObj;
        break;

      case  'ilink':
        // this is to a named internal link
        $label =  $options['label'];
        $this->objects[$id] = array('t'=>'annotation', 'info'=>$options);
        $this->numObj++;
        $this->o_action($this->numObj, 'new', array('type'=>'ilink', 'label'=>$label));
        $this->objects[$id]['info']['actionId'] = $this->numObj;
        break;
      }
      break;

    case  'out':
      $res = "\n$id 0 obj\n<< /Type /Annot";
      switch ($o['info']['type']) {
      case  'link':
      case  'ilink':
        $res.=  "\n/Subtype /Link";
        break;
      }
      $res.= "\n/A ".$o['info']['actionId']." 0 R";
      $res.= "\n/Border [0 0 0]";
      $res.= "\n/H /I";
      $res.= "\n/Rect [ ";

      foreach($o['info']['rect'] as  $v) {
        $res.=  sprintf("%.4F ", $v);
      }

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