<?php

namespace Mtc\Core;

// Extend the TCPDF class to create custom Header and Footer
class LabelPDF extends \TCPDF
{
    public $footer_html = '';
    public $footer_font_size = 10;
    public $footer_from_bottom = -15;

    public function setHtmlFooter($html)
    {
        $this->footer_html = $html;
    }

    // Page footer
    public function Footer()
    {
        // Position footer
        $this->SetY($this->footer_from_bottom);

        // Set font
        //$this->SetFont('dejavusans', '', $this->footer_font_size);
        $this->SetFont('', '', $this->footer_font_size);

        //Add custom html to footer
        $this->writeHTML($this->footer_html, true, false, true, true);
    }
}
