function Pdflabel($para) { $format = $para['format']; $unit = $para['unit']; //'mm' $posX = $para['posX']; $posY = $para['posY']; if (is_array($format)) { // Custom format $Tformat = $format; } else { // Avery format $Tformat = $this->_Avery_Labels[$format]; } parent::FPDF('P', $Tformat['metric'], $Tformat['paper-size']); $this->_Set_Format($Tformat); $this->Set_Font_Name('Arial'); $this->SetMargins(0, 0); $this->SetAutoPageBreak(false); $this->_Metric_Doc = $unit; // Start at the given label position if ($posX > 1) { $posX--; } else { $posX = 0; } if ($posY > 1) { $posY--; } else { $posY = 0; } if ($posX >= $this->_X_Number) { $posX = $this->_X_Number - 1; } if ($posY >= $this->_Y_Number) { $posY = $this->_Y_Number - 1; } $this->_COUNTX = $posX; $this->_COUNTY = $posY; }
function __construct($cr = '', $tim = '', $img = '', $orientation = 'P', $unit = 'pt', $format = 'Letter', $margin = 40) { Fpdf::FPDF($orientation, $unit, $format); Fpdf::SetTopMargin($margin); Fpdf::SetLeftMargin($margin); Fpdf::SetRightMargin($margin); Fpdf::SetAutoPageBreak(true, $margin); $this->creator = $cr; $this->time = $tim; $this->logo = $img; }