This commit is contained in:
yuri
2015-07-09 17:57:16 +03:00
parent 6fb2112e40
commit 0864f7d604
2 changed files with 39 additions and 2 deletions

View File

@@ -0,0 +1,37 @@
<?php
/************************************************************************
* This file is part of EspoCRM.
*
* EspoCRM - Open Source CRM application.
* Copyright (C) 2014-2015 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
* Website: http://www.espocrm.com
*
* EspoCRM is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* EspoCRM is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with EspoCRM. If not, see http://www.gnu.org/licenses/.
************************************************************************/
namespace Espo\Core\Pdf;
require "vendor/tecnick.com/tcpdf/tcpdf.php";
class Tcpdf extends \TCPDF
{
protected $footerHtml;
public function Footer() {
$this->SetY(-15);
$this->Cell(0, 10, $this->getAliasNumPage(), 0, false, 'C', 0, '', 0, false, 'T', 'M');
}
}

View File

@@ -27,7 +27,6 @@ use \Espo\Core\Exceptions\Forbidden;
use \Espo\Core\Exceptions\BadRequest;
use \Espo\Core\Htmlizer\Htmlizer;
require "vendor/tecnick.com/tcpdf/tcpdf.php";
class Pdf extends \Espo\Core\EntryPoints\Base
{
@@ -62,8 +61,9 @@ class Pdf extends \Espo\Core\EntryPoints\Base
$htmlizer = new Htmlizer($this->getFileManager(), $this->getDateTime(), $this->getNumber());
$pdf = new \TCPDF();
$pdf = new \Espo\Core\Pdf\Tcpdf();
$pdf->setPrintHeader(false);
//$pdf->setPrintFooter(false);
$pdf->setAutoPageBreak(true, $template->get('bottomMargin'));
$pdf->setMargins($template->get('leftMargin'), $template->get('topMargin'), $template->get('rightMargin'));