1. Go to this page and download the library: Download convertio/convertio-php library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
convertio / convertio-php example snippets
Convertio\Convertio;
$API = new Convertio("_YOUR_API_KEY_"); // You can obtain API Key here: https://convertio.co/api/
$API->startFromURL('http://google.com/', 'png') // Convert (Render) HTML Page to PNG
->wait() // Wait for conversion finish
->download('./google.png') // Download Result To Local File
->delete(); // Delete Files from Convertio hosts
Convertio\Convertio;
$API = new Convertio("_YOUR_API_KEY_"); // You can obtain API Key here: https://convertio.co/api/
$API->start('./input.docx', 'pdf')->wait()->download('./output.pdf')->delete();
Convertio\Convertio;
$API = new Convertio("_YOUR_API_KEY_"); // You can obtain API Key here: https://convertio.co/api/
$Text = $API->start('./test.docx', 'txt')->wait()->fetchResultContent()->result_content;
$API->delete();
echo $Text;
Convertio\Convertio;
$API = new Convertio("_YOUR_API_KEY_"); // You can obtain API Key here: https://convertio.co/api/
$API->settings(array('api_protocol' => 'http', 'http_timeout' => 10));
$API->startFromURL('http://google.com/', 'png')->wait()->download('./google.png')->delete();
\Convertio\Convertio;
$API = new Convertio("_YOUR_API_KEY_");
$API->start('./test.pdf', 'docx', // Convert PDF (which contain scanned pages) into editable DOCX
[ // Setting Conversion Options (Docs: https://convertio.co/api/docs/#options)
'ocr_enabled' => true, // Enabling OCR
'ocr_settings' => [ // Defining OCR Settings
'langs' => ['eng','spa'], // OCR language list (Full list: https://convertio.co/api/docs/#ocr_langs)
'page_nums' => '1-3,5,7' // Page numbers to process (optional)
]
]
)
->wait() // Wait for conversion finish
->download('./test.docx') // Download Result To Local File
->delete(); // Delete Files from Convertio hosts
Convertio\Convertio;
$API = new Convertio("_YOUR_API_KEY_");
//...