A php 7 compatible wrapper around the Pandoc file conversion software.

v1.03 2018-02-26 19:30 UTC

This package is auto-updated.

Last update: 2024-05-10 05:08:48 UTC


README

Latest Stable Version Total Downloads License Coverage Status Build Status

PHP 7 compatible wrapper around Pandoc (https://github.com/jgm/pandoc)

Usage

From file -> To file

$pandoc = new Pandoc();
$pandoc->fromFile('./from.txt')
       ->toFile('./to.docx')
       ->convert();

String content -> To file

$pandoc = new Pandoc();
$pandoc->content('<p>Wow, I really Cronenberged up the whole place, huh Morty?</p>')
       ->toFile('./to.docx')
       ->convert();

With exception handling

try{
    $pandoc = new Pandoc();
    $pandoc->fromFile('./from.txt')
           ->toFile('./to.docx')
           ->convert();
} catch(PandocException $exception) {
    echo $exception->getMessage();
}