brainite/fileconverter

Standardized file converter library.

v0.0.6 2018-08-14 20:49 UTC

This package is auto-updated.

Last update: 2024-11-10 19:12:12 UTC


README

Build Status

This PSR-4 library provides a unified interface for various file conversion utilities.

Engines Currently Supported

Convert Engines

  • AbiWord
  • Catdoc
  • Docverter
  • GhostScript
  • Htmldoc
  • ImageMagick
  • LibreOffice
  • MsgConvert
  • Pandoc
  • PhantomJs
  • Ted
  • Unoconv
  • Unrtf
  • WkHtmlToPdf
  • Xhtml2Pdf

Optimize Engines

  • JpegOptim
  • Pdftk

ReplaceString

  • Native (custom for FileConverter!)

Getting Started

Installation

Option 1: Add the "brainite/fileconverter" requirement to your composer.json configuration.

Option 2: From the command-line, execute: composer create-project brainite/fileconverter

Option 3: Download the source code from Github and then run `composer update`.

CLI: Command Line Example

<path>/bin/fileconverter <source> <dest>

PHP Example with Composer Autoload

<?php
$fc = \Brainite\FileConverter\FileConverter::factory();
$fc->convertFile($source, $destination);

CLI: STDIN/STDOUT

Use a hyphen to indicate STDIN (for input) or STDOUT (for output).

prompt> echo "## hi ##" | fileconverter - - --conversion=md:html
<h2 id="hi">hi</h2>

Default Configured Converters

This table shows the number of converters configured by default between file extensions. This markdown is generated from the command-line:

fileconverter list extension-table