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

Cpdf::output ( debug = 0 )

return the pdf stream as a string returned from the function

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

References ARC4_init(), and checkAllHere().

Referenced by stream().

                         {

  if ($debug){
    // turn compression off
    $this->options['compression']=0;
  }

  if ($this->arc4_objnum){
    $this->ARC4_init($this->encryptionKey);
  }

  $this->checkAllHere();

  $xref=array();
  $content="%PDF-1.3\n%\n";
//  $content="%PDF-1.3\n";
  $pos=strlen($content);
  foreach($this->objects as $k=>$v){
    $tmp='o_'.$v['t'];
    $cont=$this->$tmp($k,'out');
    $content.=$cont;
    $xref[]=$pos;
    $pos+=strlen($cont);
  }
  $content.="\nxref\n0 ".(count($xref)+1)."\n0000000000 65535 f \n";
  foreach($xref as $p){
    $content.=substr('0000000000',0,10-strlen($p)).$p." 00000 n \n";
  }
  $content.="\ntrailer\n  << /Size ".(count($xref)+1)."\n     /Root 1 0 R\n     /Info ".$this->infoObject." 0 R\n";
  // if encryption has been applied to this document then add the marker for this dictionary
  if ($this->arc4_objnum > 0){
    $content .= "/Encrypt ".$this->arc4_objnum." 0 R\n";
  }
  if (strlen($this->fileIdentifier)){
    $content .= "/ID[<".$this->fileIdentifier."><".$this->fileIdentifier.">]\n";
  }
  $content .= "  >>\nstartxref\n".$pos."\n%%EOF\n";
  return $content;
}

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