32 lines
1.4 KiB
PHP
32 lines
1.4 KiB
PHP
<?php
|
|
require_once __DIR__ . '/vendor/autoload.php';
|
|
|
|
if(file_exists('/var/www/rapport/storage/app/public/personalized/'.$argv[1].'/'.$argv[2]))
|
|
{
|
|
$params = file_get_contents('/var/www/rapport/storage/app/public/personalized/'.$argv[1].'/'.$argv[2]); //data read from json file
|
|
$params = json_decode($params); //decode a data
|
|
$mpdf = new \Mpdf\Mpdf(['format' => [$params->width, $params->height],
|
|
'margin_left' => 0,
|
|
'margin_right' => 0,
|
|
'margin_top' => 0,
|
|
'margin_bottom' => 0,
|
|
'margin_header' => 0,
|
|
'margin_footer' => 0,]);
|
|
$mpdf->WriteHTML('<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
<body style="margin:0px;padding:0px;">
|
|
<img src="https://stage.buildrapport.co/storage/'.$params->bg_image.'" style="width:100%">
|
|
<div style="width:5800px;height:500px;position:absolute;top:'.intval(($params->link_params_y-300)*4.03).'px;left:'.intval($params->link_params_x*4.03).'px;">
|
|
<a style="font-size:300px;color:#fff;text-decoration:none;" href="https://'.$params->link_params_url.'">'.$params->link_params_url.'</a>
|
|
</div>
|
|
</body>
|
|
</html>');
|
|
$mpdf->Output($params->output,'F');
|
|
}
|
|
|
|
|