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

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

the contents objects hold all of the content which appears on pages

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

References $options, ARC4(), and encryptInit().

Referenced by o_image(), o_page(), openObject(), and selectFont().

                                            {
  if ($action!='new'){
    $o =& $this->objects[$id];
  }
  switch ($action){
    case 'new':
      $this->objects[$id]=array('t'=>'contents','c'=>'','info'=>array());
      if (strlen($options) && intval($options)){
        // then this contents is the primary for a page
        $this->objects[$id]['onPage']=$options;
      } else if ($options=='raw'){
        // then this page contains some other type of system object
        $this->objects[$id]['raw']=1;
      }
      break;
    case 'add':
      // add more options to the decleration
      foreach ($options as $k=>$v){
        $o['info'][$k]=$v;
      }
    case 'out':
      $tmp=$o['c'];
      $res= "\n".$id." 0 obj\n";
      if (isset($this->objects[$id]['raw'])){
        $res.=$tmp;
      } else {
        $res.= "<<";
        if (function_exists('gzcompress') && $this->options['compression']){
          // then implement ZLIB based compression on this content stream
          $res.=" /Filter /FlateDecode";
          $tmp = gzcompress($tmp);
        }
        if ($this->encrypted){
          $this->encryptInit($id);
          $tmp = $this->ARC4($tmp);
        }
        foreach($o['info'] as $k=>$v){
          $res .= "\n/".$k.' '.$v;
        }
        $res.="\n/Length ".strlen($tmp)." >>\nstream\n".$tmp."\nendstream";
      }
      $res.="\nendobj\n";
      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