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

Cpdf::newPage ( insert = 0,
id = 0,
pos = 'after' 

add a new page to the document this also makes the new page the current active object

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

References o_page(), restoreState(), saveState(), setColor(), and setStrokeColor().


  // if there is a state saved, then go up the stack closing them
  // then on the new page, re-open them with the right setings
  if ($this->nStateStack){
    for ($i=$this->nStateStack;$i>=1;$i--){

  if ($insert){
    // the id from the ezPdf class is the od of the contents of the page, not the page object itself
    // query that object to find the parent
    $rid = $this->objects[$id]['onPage'];
    $opt= array('rid'=>$rid,'pos'=>$pos);
  } else {
  // if there is a stack saved, then put that onto the page
  if ($this->nStateStack){
    for ($i=1;$i<=$this->nStateStack;$i++){
  // and if there has been a stroke or fill colour set, then transfer them
  if ($this->currentColour['r']>=0){
  if ($this->currentStrokeColour['r']>=0){

  // if there is a line style set, then put this in too
  if (strlen($this->currentLineStyle)){

  // the call to the o_page object set currentContents to the present page, so this can be returned as the page id
  return $this->currentContents;

Here is the call graph for this function:

Generated by  Doxygen 1.6.0   Back to index