Download the PHP package convertio/convertio-php without Composer
On this page you can find all versions of the php package convertio/convertio-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download convertio/convertio-php
More information about convertio/convertio-php
Files in convertio/convertio-php
Package convertio-php
Short Description Official PHP Wrapper for Convertio API
License
Homepage https://github.com/convertio/convertio-php
Informations about the package convertio-php
Convertio APIs Client Library for PHP
This is a lightweight wrapper for the Convertio API.
Feel free to use, improve or modify this wrapper! If you have questions contact us or open an issue on GitHub.
Requirements
Developer Documentation
You can find full API reference here: https://convertio.co/api/docs/
Quickstart
Following example will render remote web page into PNG image:
Following example will convert local DOCX file to PDF:
Following example will extract clean text from DOCX:
Following example will override default API parameters in case you don't have SSL enabled in your PHP installation or want to limit execution time:
OCR Quickstart
Following example will convert pages 1-3,5,7 of PDF into editable DOCX, using OCR (Optical Character Recognition) for English and Spanish languages (Full list of available languages):
Installation
You can use Composer or simply Download the Release
Composer
The preferred method is via composer. Follow the installation instructions if you do not already have composer installed.
Once composer is installed, execute the following command in your project root to install this library:
Finally, be sure to include the autoloader:
Download the Release
You can download the package in its entirety. The Releases page lists all stable versions.
Download any file with the name convertio-php-[RELEASE_NAME].zip
for a package including this library and its dependencies.
Uncompress the zip file you download, and include the autoloader in your project:
Example with exceptions catching
The following example shows how to catch the different exception types which can occur at conversions:
Example of conversion process with callback URL
The following example is usable for conversions that is not instant and may require some time to complete. In this case you may define the callback URL (More info), which gets notified when the conversion is over (either successful or not):
Start conversion:
Callback handler example:
The exception handling in this code snippet is essential. Conversion errors throw APIException which have to be handled properly. Please, read more info about step parameter.
Example of conversion process being split on steps
The following example is usable for conversions that is not instant and may require some time to complete. In this case you may get the conversion ID and check the conversion status later, omitting "->wait()" call and making conversion starting process instant:
Start conversion:
Check conversion status and download the result:
The exception handling in this code snippet is essential. Conversion errors throw APIException which have to be handled properly.
Resources
All versions of convertio-php with dependencies
ext-curl Version *
ext-json Version *