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

Cpdf::o_page ( id,
options = '' 

a page object, it also creates a contents object to hold its contents

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

References $options, o_contents(), and o_pages().

Referenced by addObject(), newDocument(), newPage(), and o_annotation().

  if ($action!='new'){
    $o =& $this->objects[$id];
  switch ($action){
    case 'new':
      if (is_array($options)){
        // then this must be a page insertion, array shoudl contain 'rid','pos'=[before|after]
      } else {
      //make a contents object to go with this page
      $match = ($this->numPages%2 ? 'odd' : 'even');
      foreach($this->addLooseObjects as $oId=>$target){
        if ($target=='all' || $match==$target){
    case 'content':
    case 'annot':
      // add an annotation to this page
      if (!isset($o['info']['annot'])){
      // $options should contain the id of the annotation dictionary
    case 'out':
      $res="\n".$id." 0 obj\n<< /Type /Page";
      $res.="\n/Parent ".$o['info']['parent']." 0 R";
      if (isset($o['info']['annot'])){
        $res.="\n/Annots [";
        foreach($o['info']['annot'] as $aId){
          $res.=" ".$aId." 0 R";
        $res.=" ]";
      $count = count($o['info']['contents']);
      if ($count==1){
        $res.="\n/Contents ".$o['info']['contents'][0]." 0 R";
      } else if ($count>1){
        $res.="\n/Contents [\n";
        foreach ($o['info']['contents'] as $cId){
          $res.=$cId." 0 R\n";
      return $res;

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