Logo Search packages:      
Sourcecode: acidbase version File versions  Download package

Cpdf::o_annotation ( id,
action,
options = '' 
)

an annotation object, this will add an annotation to the current page. initially will support just link annotations

Definition at line 769 of file class.pdf.php.

References $options, o_action(), and o_page().

Referenced by addInternalLink(), and addLink().

                                              {
  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;
      break;
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:


Generated by  Doxygen 1.6.0   Back to index