?? GreyFile — Mystic File Browser

Current path: home/webdevt/cryptoimpot.fr/module/Application/src/Service/



?? Go up: /home/webdevt/cryptoimpot.fr/module/Application/src

?? Viewing: TCPDFRapport.php

<?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;

/**
 * Description of TCPDFBrouillon
 *
 * @author jimmy
 */
class TCPDFRapport extends \TCPDF {

    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');
        
    }

}


??

??