<?php
/////////////////////////////////////
date_default_timezone_set('America/Mexico_City');    // Choose local time
$FechaHora = date('d/m/Y g:i:s', time());
//echo "Post:<pre>";var_dump($_POST);echo "</pre>";
//echo "Get:<pre>";var_dump($_GET);echo "</pre>";

echo '.......................................................<br>Ult Refresh:'.$FechaHora.' / Current PHP version: ' . phpversion();echo "<br>";echo "<br>";


require __DIR__ . '/ConvertionToolsAPI/autoload.php';//librerias
use \ConvertApi\ConvertApi;

//Convierte
$pdf_file_path=__DIR__."./pdf.pdf";
$folder_path_for_images=__DIR__."./";
$format="jpg";//jpg o png

ConvertApi::setApiSecret($APIkey);

$result = ConvertApi::convert($format, [
        'File' => $pdf_file_path,
    ], 'pdf'
);
$result->saveFiles($folder_path_for_images);