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

Cpdf::setEncryption ( userPass = '',
ownerPass = '',
pc = array() 
)

set the encryption of the document can be used to turn it on and/or set the passwords which it will have. also the functions that the user will have are set here, such as print, modify, add

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

References $options, and o_encryption().

                                                              {
  $p=bindec(11000000);

  $options = array(
     'print'=>4
    ,'modify'=>8
    ,'copy'=>16
    ,'add'=>32
  );
  foreach($pc as $k=>$v){
    if ($v && isset($options[$k])){
      $p+=$options[$k];
    } else if (isset($options[$v])){
      $p+=$options[$v];
    }
  }
  // implement encryption on the document
  if ($this->arc4_objnum == 0){
    // then the block does not exist already, add it.
    $this->numObj++;
    if (strlen($ownerPass)==0){
      $ownerPass=$userPass;
    }
    $this->o_encryption($this->numObj,'new',array('user'=>$userPass,'owner'=>$ownerPass,'p'=>$p));
  }
}

Here is the call graph for this function:


Generated by  Doxygen 1.6.0   Back to index