1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-14 07:02:34 +01:00
invoiceninja/app/Utils/Traits/Pdf/PDF.php
2022-05-25 22:00:17 +10:00

40 lines
889 B
PHP

<?php
/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/
namespace App\Utils\Traits\Pdf;
use setasign\Fpdi\Fpdi;
class PDF extends FPDI
{
public $text_alignment = 'L';
function Footer()
{
$this->SetXY(0, -5);
$this->SetFont('Arial','I', 9);
$this->SetTextColor(135,135,135);
$trans = ctrans('texts.pdf_page_info', ['current' => $this->PageNo(), 'total' => '{nb}']);
$this->Cell(0,5, $trans ,0,0, $this->text_alignment);
}
public function setAlignment($alignment)
{
if(in_array($alignment, ['C','L','R']))
$this->text_alignment = $alignment;
return $this;
}
}