original_string: public function get_page_count() {
          if ($this->pagecount) {
              return $this->pagecount;
          }
  
          $status = $this->get_status();
  
          if ($status === self::STATUS_FAILED) {
              // The empty document will be returned.
              return 1;
          }
  
          if ($status !== self::STATUS_COMPLETE) {
              // No pages yet.
              return 0;
          }
  
          // Load the PDF to determine the page count.
          $temparea = make_request_directory();
          $tempsrc = $temparea . "/source.pdf";
          $this->get_combined_file()->copy_content_to($tempsrc);
  
          $pdf = new pdf();
          $pagecount = $pdf->load_pdf($tempsrc);
          $pdf->Close();
  
          if ($pagecount <= 0) {
              // Something went wrong. Return an empty page count again.
              return 0;
          }
  
          $this->pagecount = $pagecount;
          return $this->pagecount;
      }
code: public function get_page_count() {
          if ($this->pagecount) {
              return $this->pagecount;
          }
  
          $status = $this->get_status();
  
          if ($status === self::STATUS_FAILED) {
              // The empty document will be returned.
              return 1;
          }
  
          if ($status !== self::STATUS_COMPLETE) {
              // No pages yet.
              return 0;
          }
  
          // Load the PDF to determine the page count.
          $temparea = make_request_directory();
          $tempsrc = $temparea . "/source.pdf";
          $this->get_combined_file()->copy_content_to($tempsrc);
  
          $pdf = new pdf();
          $pagecount = $pdf->load_pdf($tempsrc);
          $pdf->Close();
  
          if ($pagecount <= 0) {
              // Something went wrong. Return an empty page count again.
              return 0;
          }
  
          $this->pagecount = $pagecount;
          return $this->pagecount;
      }
code_tokens: public function get_page_count ( ) { if ( $ this -> pagecount ) { return $ this -> pagecount ; } $ status = $ this -> get_status ( ) ; if ( $ status === self :: STATUS_FAILED ) { // The empty document will be returned. return 1 ; } if ( $ status !== self :: STATUS_COMPLETE ) { // No pages yet. return 0 ; } // Load the PDF to determine the page count. $ temparea = make_request_directory ( ) ; $ tempsrc = $ temparea . "/source.pdf" ; $ this -> get_combined_file ( ) -> copy_content_to ( $ tempsrc ) ; $ pdf = new pdf ( ) ; $ pagecount = $ pdf -> load_pdf ( $ tempsrc ) ; $ pdf -> Close ( ) ; if ( $ pagecount <= 0 ) { // Something went wrong. Return an empty page count again. return 0 ; } $ this -> pagecount = $ pagecount ; return $ this -> pagecount ; }
docstring: Get the total number of pages in the combined document.
  
  If there are no pages, or it is not yet possible to count them a
  value of 0 is returned.
  
  @return  int
docstring_tokens: Get the total number of pages in the combined document .