public function convert($content, $from, $to)
    {
        if ( ! in_array($from, $this->inputFormats)) {
            throw new PandocException(
                sprintf('%s is not a valid input format for pandoc', $from)
            );
        }

        if ( ! in_array($to, $this->outputFormats)) {
            throw new PandocException(
                sprintf('%s is not a valid output format for pandoc', $to)
            );
        }

        file_put_contents($this->tmpFile, $content);

        $command = sprintf(
            '%s --from=%s --to=%s %s',
            $this->executable,
            $from,
            $to,
            $this->tmpFile
        );

        exec(escapeshellcmd($command), $output);

        return implode("\n", $output);
    }
public function convert($content, $from, $to)
    {
        if ( ! in_array($from, $this->inputFormats)) {
            throw new PandocException(
                sprintf('%s is not a valid input format for pandoc', $from)
            );
        }

        if ( ! in_array($to, $this->outputFormats)) {
            throw new PandocException(
                sprintf('%s is not a valid output format for pandoc', $to)
            );
        }

        file_put_contents($this->tmpFile, $content);

        $command = sprintf(
            '%s --from=%s --to=%s %s',
            $this->executable,
            $from,
            $to,
            $this->tmpFile
        );

        exec(escapeshellcmd($command), $output);

        return implode("\n", $output);
    }
public function convert ( $ content , $ from , $ to ) { if ( ! in_array ( $ from , $ this -> inputFormats ) ) { throw new PandocException ( sprintf ( '%s is not a valid input format for pandoc' , $ from ) ) ; } if ( ! in_array ( $ to , $ this -> outputFormats ) ) { throw new PandocException ( sprintf ( '%s is not a valid output format for pandoc' , $ to ) ) ; } file_put_contents ( $ this -> tmpFile , $ content ) ; $ command = sprintf ( '%s --from=%s --to=%s %s' , $ this -> executable , $ from , $ to , $ this -> tmpFile ) ; exec ( escapeshellcmd ( $ command ) , $ output ) ; return implode ( "\n" , $ output ) ; }
Run the conversion from one type to another

@param string $from The type we are converting from
@param string $to   The type we want to convert the document to

@return string
Run the conversion from one type to another