Current path: home/webdevt/cryptoimpot.fr/module/Application/src/Service/
?? Go up: /home/webdevt/cryptoimpot.fr/module/Application/src
<?php
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
namespace Application\Service;
use setasign\Fpdi\Tfpdf\Fpdi;
/**
* Description of TCPDFBrouillon
*
* @author jimmy
*/
//class FPDIFormulaire2048m extends \setasign\Fpdi\Tcpdf\Fpdi {
class FPDIFormulaire2048m extends \TCPDF {
/**
* "Remembers" the template id of the imported page
*/
protected $tplId = [];
protected $container;
public function __construct($orientation = 'P', $unit = 'mm', $format = 'A4', $unicode = true, $encoding = 'UTF-8', $diskcache = false, $container) {
// public function __construct($container) {
// //var_dump($container); exit;
$this->container = $container;
// parent::__construct($orientation, $unit = 'mm', $format = 'A4', $unicode = true, $encoding = 'UTF-8', $diskcache = false, $container);
parent::__construct();
}
/**
* Draw an imported PDF logo on every page
*/
function Header()
{
$config = $this->container->get('config');
$bMargin = $this->getBreakMargin();
// get current auto-page-break mode
$auto_page_break = $this->AutoPageBreak;
// disable auto-page-break
$this->SetAutoPageBreak(false, 0);
// set bacground image
// $img_file = K_PATH_IMAGES.'image_demo.jpg';
// $img_file = $config['path-app'].'/public/form/2048-m-sd_2950-1.jpg';
// $this->Image($img_file, 0, 0, 210, 297, 'JPG', '', '', false, 300, '', false, false, 0);
// $this->AddPage();
// restore auto-page-break status
$this->SetAutoPageBreak($auto_page_break, $bMargin);
// set the starting point for the page content
$this->setPageMark();
// $config = $this->container->get('config');
//
// $pageCount = $this->setSourceFile( $config['path-app'] . '/public/form/2048-m-sd_2950.pdf');
//
// for ($pageNo = 1; $pageNo <= 2; $pageNo++) {
//
// //if (empty($this->tplId[$pageNo]) && $this->tplId[$pageNo] === null) {
// $tplId = $this->importPage($pageNo);
//// $size = $this->useImportedPage($tplId, 0, 0, 210);
// $this->AddPage();
// $this->useTemplate($tplId, 0, 0, 0, 0, true);
// //$this->AddPage($size['orientation'], array($size[0], $size[1]));
// //}
//
//// $this->tplId[$pageNo] = $this->importPage($pageNo);
//// // get the size of the imported page
////// $size = $this->getTemplateSize($this->tplId[$pageNo]);
//// $size = $this->useImportedPage($this->tplId[$pageNo], 0, 0, 210);
////
//// // create a page (landscape or portrait depending on the imported page size)
////// if ($size[0] > $size[1]) {
////// $this->AddPage('L', array($size[0], $size[1]));
////// } else {
//// $this->AddPage('P', array($size[0], $size[1]));
////// }
////
//// // use the imported page
//// $this->useTemplate($this->tplId[$pageNo]);
//
// }
//
//
//// $size = $this->useImportedPage($this->tplId, 0, 0, 210);
//
// $this->SetFont('freesans', 'B', 20);
// $this->SetTextColor(0);
// $this->SetXY(PDF_MARGIN_LEFT, 5);
// $this->Cell(0, 10, 'TCPDF and FPDI');
}
function Footer()
{
// emtpy method body
}
// public $titlePDFCustom;
//
// public function __construct($orientation = 'P', $unit = 'mm', $format = 'A4', $unicode = true, $encoding = 'UTF-8', $diskcache = false, $container) {
// //var_dump($container); exit;
// $this->container = $container;
// parent::__construct(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
// }
//
// public function Header() {
// // Logo
// //$this->SetY(-35);
//// $this->SetY(0);
// // var_dump($this->container);
// $config = $this->container->get('config');
// //var_dump($config['path-app']); exit;
//// var_dump(K_PATH_IMAGES); exit;
//// $image_file = $config['path-app'] . '/vendor/tecnickcom/tcpdf/examples/images/logo_example.jpg';
//// $image_file = $config['path-app'] . '/public/img/logo.jpg';
//// $image_file = $config['path-app'] . '/public/img/logo.svg';
//// //$this->Image($image_file, 10, 10, 15, '', 'JPG', '', 'T', false, 300, '', false, false, 0, false, false, false);
////$this->ImageSVG($image_file, $x='10', $y='10', $w=30, $h=30, $link='', $align='', $palign='', $border=0, $fitonpage=false);
////
//// $this->SetY(14);
//// // Set font
//// $this->SetFont('helvetica', 'B', 12);
//// // Title
//// $this->Cell(0, 25, $this->titlePDFCustom, 0, false, 'C', 0, '', 0, false, 'M', 'M');
// $svg = $config['path-app'] . '/public/img/logo.svg';
// $doc = new \DOMDocument;
// $doc->load($svg);
// $xpath = new \DOMXPath($doc);
// $xpath->registerNamespace('svg', 'http://www.w3.org/2000/svg');
// $path_list = $xpath->query('svg:path');
// $circle_list = $xpath->query('svg:circle');
// foreach ($path_list as $path) {
// $path->setAttribute('fill', '#000000');
// }
// foreach ($circle_list as $circle) {
// $circle->setAttribute('fill', '#000000');
// }
// $svgString = $doc->saveXML();
//
//
// // remettre pour ledgio $this->ImageSVG('@' . $svgString, $x=5, $y=11, $w=4, $h=4, $link='', $align='', $palign='', $border=0, $fitonpage=false);
//
//$this->SetY(10);
//$this->SetX(10);
//$this->SetFont('helvetica', 'B', 12);
//// remettre pour ledgio $this->Cell($w=4, $h=0, $txt='Ledgio', $border=0, $ln=0, $align='', $fill=false, $link='', $stretch=0, $ignore_min_height=false, $calign='T', $valign='M');
//
//
//// $this->SetY(95);
//// $this->SetY(0);
// // Set font
// $this->SetY(10);
// $this->SetX(30);
// // Set font
// $this->SetFont('helvetica', 'B', 12);
// //$this->SetFont('helvetica', 'B', 15);
// // Title
// $this->Cell($w=4, $h=0, $txt=$this->titlePDFCustom, $border=0, $ln=0, $align='', $fill=false, $link='', $stretch=0, $ignore_min_height=false, $calign='T', $valign='M');
//
//
//
// $this->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
//
//
//
//
// // Get the current page break margin
// //$bMargin = $this->getBreakMargin();
// // Get current auto-page-break mode
// //$auto_page_break = $this->AutoPageBreak;
// // Disable auto-page-break
// //$this->SetAutoPageBreak(false, 0);
// // Restore the auto-page-break status
// //$this->SetAutoPageBreak($auto_page_break, $bMargin);
// // Set the starting point for the page content
// $this->setPageMark();
// $this->SetHeaderMargin(PDF_MARGIN_HEADER);
// }
//
// public function Footer() {
// // Page footer
// // Position at 15 mm from bottom
// $this->SetY(-15);
// // Set font
// $this->SetFont('helvetica', 'I', 8);
// // Page number
// $this->Cell(0, 10, 'Page ' . $this->getAliasNumPage() . '/' . $this->getAliasNbPages(), 0, false, 'C', 0, '', 0, false, 'T', 'M');
//
// }
}