<?php

if (!class_exists('DL_OrderFlow_Pdf') && class_exists('\setasign\Fpdi\Fpdi')) {

    class DL_OrderFlow_Pdf extends \setasign\Fpdi\Fpdi {

        public function __construct($orientation='P', $unit='mm', $size=array(210,297)) {
            // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log -- Debug-only logging
            error_log("DL_OrderFlow_Pdf constructed");
            parent::__construct($orientation, $unit, $size);
        }

        public function Footer() {
            // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log -- Debug-only logging
            error_log("DL_OrderFlow_Pdf FOOTER CALLED");
            $this->SetY(-15);
            $this->SetFont('Arial', 'I', 8);
            $this->Cell(0, 10, 'Page '.$this->PageNo().' of {nb}', 0, 0, 'C');
        }
    }
}
