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