original_string: protected function getRawOutput($file)
      {
          if (!$this->isAvailable()) {
              throw new Exception("getRawOutput called on unavailable extractor");
          }
  
          $path = $file instanceof File ? $this->getPathFromFile($file) : $file;
          exec(sprintf('%s %s - 2>&1', $this->bin('pdftotext'), escapeshellarg($path)), $content, $err);
          if ($err) {
              if (!is_array($err) && $err == 1) {
                  // For Windows compatibility
                  $err = $content;
              }
  
              throw new Exception(sprintf(
                  'PDFTextExtractor->getContent() failed for %s: %s',
                  $path,
                  implode(PHP_EOL, $err)
              ));
          }
  
          return implode(PHP_EOL, $content);
      }
code: protected function getRawOutput($file)
      {
          if (!$this->isAvailable()) {
              throw new Exception("getRawOutput called on unavailable extractor");
          }
  
          $path = $file instanceof File ? $this->getPathFromFile($file) : $file;
          exec(sprintf('%s %s - 2>&1', $this->bin('pdftotext'), escapeshellarg($path)), $content, $err);
          if ($err) {
              if (!is_array($err) && $err == 1) {
                  // For Windows compatibility
                  $err = $content;
              }
  
              throw new Exception(sprintf(
                  'PDFTextExtractor->getContent() failed for %s: %s',
                  $path,
                  implode(PHP_EOL, $err)
              ));
          }
  
          return implode(PHP_EOL, $content);
      }
code_tokens: protected function getRawOutput ( $ file ) { if ( ! $ this -> isAvailable ( ) ) { throw new Exception ( "getRawOutput called on unavailable extractor" ) ; } $ path = $ file instanceof File ? $ this -> getPathFromFile ( $ file ) : $ file ; exec ( sprintf ( '%s %s - 2>&1' , $ this -> bin ( 'pdftotext' ) , escapeshellarg ( $ path ) ) , $ content , $ err ) ; if ( $ err ) { if ( ! is_array ( $ err ) && $ err == 1 ) { // For Windows compatibility $ err = $ content ; } throw new Exception ( sprintf ( 'PDFTextExtractor->getContent() failed for %s: %s' , $ path , implode ( PHP_EOL , $ err ) ) ) ; } return implode ( PHP_EOL , $ content ) ; }
docstring: Invoke pdftotext with the given File object
  
  @param  File|string $file
  @return string Output
  @throws Exception
docstring_tokens: Invoke pdftotext with the given File object