Add logo and fairname to labels (still doesn't scale the contents of the

label).
This commit is contained in:
dave 2010-06-09 05:21:42 +00:00
parent 76e8f8c3e2
commit a46cb110ca
2 changed files with 14 additions and 3 deletions

View File

@ -411,8 +411,6 @@ $doCanvasSample = false;
if($l_w && $l_h && $report['option']['type']=='label') {
echo "<h4>Label Data Locations</h4>";
$l_w *= 25.4;
$l_h *= 25.4;
$doCanvasSample=true;
$ratio=$l_h/$l_w;
$canvaswidth=600;

View File

@ -315,6 +315,7 @@ class pdf extends TCPDF {
function label_new()
{
global $config;
/* Advance to new label */
// echo "cindex=$this->current_label_index, perpage=$this->labels_per_page\n";
if($this->current_label_index + 1 == $this->labels_per_page) {
@ -340,11 +341,23 @@ class pdf extends TCPDF {
if($this->label_show_box)
$this->label_rect(0,0,$this->label_width, $this->label_height);
$w = $this->label_width * 0.2;
$h = $this->label_height * 0.2;
if($w < $h) $h = $w;
else $w = $h;
if($this->label_show_logo) {
$img_dir = $_SERVER['DOCUMENT_ROOT'].$config['SFIABDIRECTORY'].'/data';
/* Scale image to proportinally fit in w x h */
$this->Image("$img_dir/logo.jpg", $this->lMargin + 1, $this->tMargin + 1,
$w, $h, '', '', '', true,
300, '', false, false, 0, true);
}
if($this->label_show_fair) {
$this->SetXY($this->lMargin + $w + 2, $this->tMargin + 1);
$this->SetFontSize(((($h / 2) - $this->cMargin) / 25.4) * 72);
$this->FitCell($this->label_width - $w - 2, $this->label_height *0.2,
$config['fairname'], 0, 0, 'L', 'M', 'scale');
}
}