doctype=$doctype; } /*********************************** * data aggregation functions ***********************************/ // label settings public function setBarcode($barcode) { $this->barcode = $barcode; } public function setBarcode2($barcode) { $this->barcode2 = $barcode; } public function setSubBarcodeText($text) { $this->subbarcodetxt = $text; } public function setSubBarcode2Text($text) { $this->subbarcode2txt = $text; } public function setPreBarcodeText($text) { $this->prebarcodetxt = $text; } public function setPreBarcode2Text($text) { $this->prebarcode2txt = $text; } public function setPostBarcodeText($text) { $this->postbarcodetxt = $text; } public function setPostBarcode2Text($text) { $this->postbarcode2txt = $text; } public function displayDocument() { $this->renderDocument(); $this->Output(); } public function sendDocument() { $this->renderDocument(); return $this->Output($this->filename,'S'); } /*********************************** * private functions ***********************************/ private function renderDocument() { if($this->doctype=="chargeklein") { PDF::__construct('P','mm',array(25,10)); } elseif($this->doctype=="chargegross") { PDF::__construct('P','mm',array(100,45)); } $this->AddFont('HelveticaBoldCond','','HLBC____.php'); $this->AddFont('HelveticaBoldCondItalic','','HLBCO___.php'); $this->AddFont('HelveticaCond','','HLC_____.php'); $this->AddFont('HelveticaCondItalic','','HLCO____.php'); $this->AddPage(); $this->SetDisplayMode("real","single"); if($this->doctype=="chargeklein") { $this->SetFont('Courier','B',7); if(isset($this->prebarcodetxt)) $this->Text(1,3, $this->prebarcodetxt); if(isset($this->prebarcode2txt))$this->Text(1,8.5,$this->prebarcode2txt); $this->SetFont('Courier','B',7); if(isset($this->subbarcodetxt)) $this->Text(1,5.5, $this->subbarcodetxt); if(isset($this->barcode)) $this->Code39(5,1.5,$this->barcode, 0.5, 1.5); if(isset($this->barcode2)) $this->Code39(5,7, $this->barcode2, 0.5, 1.5); } elseif($this->doctype=="chargegross") { $this->SetAutoPageBreak(false); $this->SetMargins(1,1); $this->SetFont('Courier','B',10); if(isset($this->postbarcodetxt)) { $this->SetXY(60,1); $this->MultiCell(60,4,$this->postbarcodetxt); } if(isset($this->subbarcodetxt)) { $this->SetXY(1,12.5); $this->MultiCell(60,4,$this->subbarcodetxt); } if(isset($this->subbarcode2txt))$this->Text(2, 43, $this->subbarcode2txt); if(isset($this->barcode)) $this->Code39(2,2, $this->barcode, 0.5,10); if(isset($this->barcode2)) $this->Code39(2,30,$this->barcode2,0.5,10); // draw table $this->SetDrawColor(128,128,128); $this->SetLineWidth(.3); $this->SetXY(60,18); for($i=0;$i<4;$i++){ for($j=0;$j<4;$j++) $this->Cell(9,6,"",1,0); $this->SetXY(60,$this->GetY()+6); } } } }