. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
| Server IP : 52.223.31.75 / Your IP : 172.31.6.220 [ Web Server : Apache/2.4.66 () OpenSSL/1.0.2k-fips PHP/7.4.33 System : Linux ip-172-31-14-81.eu-central-1.compute.internal 4.14.281-212.502.amzn2.x86_64 #1 SMP Thu May 26 09:52:17 UTC 2022 x86_64 User : apache ( 48) PHP Version : 7.4.33 Disable Function : NONE Domains : 4 Domains MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : OFF Directory : /var/www/davide/app/helpers/covertapi-php/ |
Upload File : |
<?php
namespace ConvertAPI;
require_once('ConvertAPI.php');
/**
* Extends the ConvertAPI class to convert various documents into PDF
* format via convertapi.com.
*/
abstract class Abstract2Pdf extends ConvertAPI {
/* Magic methods. */
/**
* Magic setter method. Checks and sets values for $_additionalParameters.
*
* @param string $name Name of the additional parameter to set.
* @param string $value Value to set the parameter to.
*/
public function __set($name, $value) {
switch ($name) {
case 'DocumentTitle': case 'DocumentSubject':
case 'DocumentAuthor': case 'DocumentKeywords':
if (is_string($value)) {
$this->_additionalParameters[$name] = $value;
} else {
throw new \Exception($name.' must be a string.');
}
break;
case 'OutputFormat':
if (is_string($value) && in_array($value, array('pdf', 'pdfa', 'png', 'jpg', 'tif'))) {
$this->_additionalParameters[$name] = $value;
} else {
throw new \Exception($name.' must be "pdf", "pdfa", "png", "jpg" or "tif".');
}
break;
case 'AlternativeParser': case 'StoreFile':
if (is_bool($value)) {
$this->_additionalParameters[$name] = $value;
} else {
throw new \Exception($name.' must be a boolean value.');
}
break;
case 'Timeout':
if (is_int($value) && $value >= 5 && $value <= 1200) {
$this->_additionalParameters[$name] = $value;
} else {
throw new \Exception($name.' must be an integer between 5 and 1200.');
}
break;
}
}
}