Change header size, add custom footer.

This commit is contained in:
dave 2010-03-30 07:02:15 +00:00
parent 96601ce1f4
commit a24df7f144

View File

@ -13,6 +13,7 @@ class pdf extends TCPDF {
var $label_show_fair, $label_show_box, $label_show_logo;
var $current_label_index;
var $footer_string;
function __construct($report_name='', $format='LETTER', $orientation='P')
{
@ -60,8 +61,8 @@ class pdf extends TCPDF {
i18n($report_name));
// set header and footer fonts
$this->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
$this->setFooterFont(Array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
$this->setHeaderFont(Array('helvetica', '', 14));
$this->setFooterFont(Array('helvetica', '', 8));
// set default monospaced font
$this->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
@ -73,7 +74,7 @@ class pdf extends TCPDF {
//set auto page breaks
$this->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
$this->setPrintFooter(false);
$this->setPrintFooter(TRUE);
//set image scale factor
$this->setImageScale(PDF_IMAGE_SCALE_RATIO);
@ -82,6 +83,9 @@ class pdf extends TCPDF {
$this->current_label_row = 0;
$this->current_label_col = 0;
$this->footer_string = date("Y-m-d h:ia").' - '.$report_name;
//set some language-dependent strings
//$this->setLanguageArray($l);
//print_r($this->fontlist);
@ -236,6 +240,18 @@ class pdf extends TCPDF {
return $this->fontlist;
}
function Footer()
{
$ormargins = $this->getOriginalMargins();
$pagenumtxt = i18n('Page').' '.$this->getAliasNumPage().' / '.$this->getAliasNbPages();
$this->SetX($ormargins['left']);
$this->Cell(0, 0, $pagenumtxt, 'T', 0, 'R');
$this->SetX($ormargins['left']);
$this->Cell(0, 0, $this->footer_string, 0, 0, 'C');
}
function setup_for_labels($show_box, $show_fair, $show_logo, $width, $height, $xspacer, $yspacer, $rows, $cols)
{
/* No headers and footers */