/** * Constructor * * @param $format type of label ($_AveryValues) * @param unit type of unit used we can define your label properties in inches by setting metric to 'in' * * @access public */ function __construct($format, $unit = 'mm') { if (is_array($format)) { // Custom format $tFormat = $format; } else { // Avery format $tFormat = $this->averyLabels[$format]; } parent::UFPDF('P', $tFormat['metric'], $tFormat['paper-size']); $this->SetFormat($tFormat); $this->SetFontName('Arial'); $this->SetMargins(0, 0); $this->SetAutoPageBreak(false); $this->metricDoc = $unit; if ($format) { if ($averyLabels['lMargin'] > 1) { $averyLabels['lMargin']--; } else { $averyLabels['lMargin'] = 0; } if ($averyLabels['tMargin'] > 1) { $averyLabels['tMargin']--; } else { $averyLabels['tMargin'] = 0; } if ($averyLabels['lMargin'] >= $this->xNumber) { $averyLabels['lMargin'] = $this->xNumber - 1; } if ($averyLabels['tMargin'] >= $this->yNumber) { $averyLabels['tMargin'] = $this->yNumber - 1; } $this->countX = $averyLabels['lMargin']; $this->countY = $averyLabels['tMargin']; } }
/** * Constructor * * @param $format type of label ($_AveryValues) * @param unit type of unit used we can define your label properties in inches by setting metric to 'in' * * @access public */ function __construct($format, $unit = 'mm') { if (is_array($format)) { // Custom format $tFormat = $format; } else { // Avery format $tFormat = $this->averyLabels[$format]; } parent::UFPDF('P', $tFormat['metric'], $tFormat['paper-size']); $this->SetFormat($tFormat); $this->SetFontName('Arial'); $this->SetMargins(0, 0); $this->SetAutoPageBreak(false); $this->metricDoc = $unit; // Start at the given label position // if ($posX > 1) $posX--; else $posX=0; // if ($posY > 1) $posY--; else $posY=0; // if ($posX >= $this->xNumber) $posX = $this->xNumber-1; // if ($posY >= $this->yNumber) $posY = $this->yNumber-1; // $this->countX = $posX; // $this->countY = $posY; if ($format == CRM_Utils_Array::value('name', $averyLabels)) { if ($averyLabels['lMargin'] > 1) { $averyLabels['lMargin']--; } else { $averyLabels['lMargin'] = 0; } if ($averyLabels['tMargin'] > 1) { $averyLabels['tMargin']--; } else { $averyLabels['tMargin'] = 0; } if ($averyLabels['lMargin'] >= $this->xNumber) { $averyLabels['lMargin'] = $this->xNumber - 1; } if ($averyLabels['tMargin'] >= $this->yNumber) { $averyLabels['tMargin'] = $this->yNumber - 1; } $this->countX = $averyLabels['lMargin']; $this->countY = $averyLabels['tMargin']; } }
function UFPDF_2($orientation='P',$unit='mm',$format='A4') { UFPDF::UFPDF($orientation, $unit, $format); }