wp-duckbehaviorjournal/PaperPDF.php

24 lines
831 B
PHP
Raw Normal View History

<?php
require_once get_template_directory() . '/vendor/autoload.php';
class PaperPDF extends TCPDF {
// Page header
public function Header() {
$logo_url = wp_get_attachment_image_url(get_theme_mod('custom_logo'), 'full');
if ($logo_url) {
$this->Image($logo_url, 10, 10, 50, '', '', '', 'T', false, 300, '', false, false, 0, false, false, false);
}
$this->SetFont('helvetica', 'B', 20);
$this->Cell(0, 15, get_bloginfo('name'), 0, false, 'C', 0, '', 0, false, 'T', 'M');
$this->Ln(20);
}
// Page footer
public function Footer() {
$this->SetY(-15);
$this->SetFont('helvetica', 'I', 8);
$this->Cell(0, 10, 'Page ' . $this->getAliasNumPage() . '/' . $this->getAliasNbPages(), 0, false, 'C', 0, '', 0, false, 'T', 'M');
}
}