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);
    }