src/SGH/PdfBox/PdfBox.php
protected function execute(Command $command)
    {
        $command->setJar($this->getPathToPdfBox());
        $command->setOptions($this->_options);
        exec((string) $command . ' 2>&1', $stdErr, $exitCode);
        if ($command->getPdfFileIsTemp()) {
            unlink($command->getPdfFile());
        }
        if ($exitCode > 0) {
            throw new \RuntimeException(join("\n", $stdErr), $exitCode);
        }
        $resultFile = $command->getTextFile();
        $result = file_get_contents($resultFile);
        if ($command->getTextFileIsTemp()) {
            unlink($resultFile);
        }
        return $result;
    }
protected function execute(Command $command)
    {
        $command->setJar($this->getPathToPdfBox());
        $command->setOptions($this->_options);
        exec((string) $command . ' 2>&1', $stdErr, $exitCode);
        if ($command->getPdfFileIsTemp()) {
            unlink($command->getPdfFile());
        }
        if ($exitCode > 0) {
            throw new \RuntimeException(join("\n", $stdErr), $exitCode);
        }
        $resultFile = $command->getTextFile();
        $result = file_get_contents($resultFile);
        if ($command->getTextFileIsTemp()) {
            unlink($resultFile);
        }
        return $result;
    }
Execute given Command object.

@param Command $command
@throws \RuntimeException If PdfBox returns error exit code
@return string            The converted text or HTML as string