function newDocument($pageSize=array(0,0,612,792)){
    $this->numObj=0;
    $this->objects = array();

    $this->numObj++;
    $this->o_catalog($this->numObj,'new');

    $this->numObj++;
    $this->o_outlines($this->numObj,'new');

    $this->numObj++;
    $this->o_pages($this->numObj,'new');

    $this->o_pages($this->numObj,'mediaBox',$pageSize);
    $this->currentNode = 3;

    $this->numObj++;
    $this->o_procset($this->numObj,'new');

    $this->numObj++;
    $this->o_info($this->numObj,'new');

    $this->numObj++;
    $this->o_page($this->numObj,'new');

    // need to store the first page id as there is no way to get it to the user during
    // startup
    $this->firstPageId = $this->currentContents;
    }