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);
    }
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);
    }
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 ) ; }
Invoke pdftotext with the given File object

@param  File|string $file
@return string Output
@throws Exception
Invoke pdftotext with the given File object