2017 © Pedro Peláez
 

application convertapi-php

PHP library for the convertapi.com REST API.

image

knyga/convertapi-php

PHP library for the convertapi.com REST API.

  • Thursday, September 17, 2015
  • by knyga
  • Repository
  • 1 Watchers
  • 0 Stars
  • 130 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 4 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

convertapi-php

PHP library for the convertapi.com REST API., (*1)

ConvertApi is an online file conversion service for creating PDF and Images from various source files, such as Word documents, web pages and raw HTML. converapi-php provides a set of classes for using the ConvertApi service with PHP., (*2)

Development of this library is not in any way connected with Baltsoft Software., (*3)

Installation via Composer

  • Install Composer to your project root:, (*4)

    curl -sS https://getcomposer.org/installer | php
    
  • Add a composer.json file to your project:, (*5)

    {
        "require": {
            "knyga/convertapi-php": "dev-master"
        }
    }
    
  • Run the Composer installer:, (*6)

    php composer.phar install
    

Using

Using the library is simple:, (*7)

  1. Include the required concrete class ( include('Text2PDF.php'); )
  2. Instantiate the class ( $text2pdf = new ConvertAPI\Text2Pdf(); )
  3. Either:
    1. Carry out the conversion using filesystem path for output ( $text2pdf->convert('/path/to/intput/file.txt', '/path/to/output/file.pdf'); )
    2. Carry out the conversion using function return for output ( $text2pdf->convert('/path/to/intput/file.txt'); )

The conversion will write the converted document to the given filesystem path and return verious details about the conversion (depending on the response from ConvertApi), or return a binary string representation of the document., (*8)

See example/example.php for a working example., (*9)

Extending

The library currently supports all the conversions available via convertapi.com., (*10)

Addition of new conversions is simply a matter of extending the abstract ConvertAPI class and, (*11)

a) defining: * $_apiUrl - the URL of the ConvertApi endpoint (see http://www.convertapi.com/ for details) * $_validInputFormats - an array of document types (extensions) which can be converted, (*12)

b) completing function __set() to handle additional valid parameters for the conversion being defined., (*13)

The Versions

17/09 2015

dev-master

9999999-dev https://github.com/knyga/convertapi-php

PHP library for the convertapi.com REST API.

  Sources   Download

GNU

The Requires

  • php >= 5.4
  • lib-curl *

 

by Oleksandr Knyga
by ConfuzzledDuck

curl knyga convertapi confuzzledduck