2022-05-25 03:00:20 +02:00
|
|
|
<?php
|
2022-05-25 08:34:43 +02:00
|
|
|
/**
|
|
|
|
* Invoice Ninja (https://invoiceninja.com).
|
|
|
|
*
|
|
|
|
* @link https://github.com/invoiceninja/invoiceninja source repository
|
|
|
|
*
|
2023-01-28 23:21:40 +01:00
|
|
|
* @copyright Copyright (c) 2023. Invoice Ninja LLC (https://invoiceninja.com)
|
2022-05-25 08:34:43 +02:00
|
|
|
*
|
|
|
|
* @license https://www.elastic.co/licensing/elastic-license
|
|
|
|
*/
|
2022-05-25 03:00:20 +02:00
|
|
|
|
|
|
|
namespace App\Utils\Traits\Pdf;
|
|
|
|
|
|
|
|
use setasign\Fpdi\Fpdi;
|
2022-06-21 11:57:17 +02:00
|
|
|
|
2022-05-25 03:00:20 +02:00
|
|
|
class PDF extends FPDI
|
|
|
|
{
|
2022-05-25 08:34:43 +02:00
|
|
|
public $text_alignment = 'L';
|
|
|
|
|
2022-06-21 11:57:17 +02:00
|
|
|
public function Footer()
|
2022-05-25 03:00:20 +02:00
|
|
|
{
|
2023-01-09 23:55:20 +01:00
|
|
|
$this->SetXY(0, -6);
|
2022-06-21 11:57:17 +02:00
|
|
|
$this->SetFont('Arial', 'I', 9);
|
2022-12-08 04:19:43 +01:00
|
|
|
|
2022-06-21 11:57:17 +02:00
|
|
|
$this->SetTextColor(135, 135, 135);
|
2022-05-25 08:34:43 +02:00
|
|
|
|
|
|
|
$trans = ctrans('texts.pdf_page_info', ['current' => $this->PageNo(), 'total' => '{nb}']);
|
2022-12-21 12:27:27 +01:00
|
|
|
// $trans = iconv('UTF-8', 'ISO-8859-7', $trans);
|
2022-06-21 11:57:17 +02:00
|
|
|
$this->Cell(0, 5, $trans, 0, 0, $this->text_alignment);
|
2022-05-25 03:00:20 +02:00
|
|
|
}
|
2022-05-25 08:34:43 +02:00
|
|
|
|
|
|
|
public function setAlignment($alignment)
|
|
|
|
{
|
2022-06-21 11:57:17 +02:00
|
|
|
if (in_array($alignment, ['C', 'L', 'R'])) {
|
2022-05-25 12:53:12 +02:00
|
|
|
$this->text_alignment = $alignment;
|
2022-06-21 11:57:17 +02:00
|
|
|
}
|
2022-05-25 08:34:43 +02:00
|
|
|
|
|
|
|
return $this;
|
|
|
|
}
|
2022-06-21 11:57:17 +02:00
|
|
|
}
|