예제 #1
0
//$pdf->SetFont("FreeSerif","",PREF_ETIQ_CORPS);
// Set origin
// Top left corner
$yorigin = round($preferences->pref_etiq_marges_v);
$xorigin = round($preferences->pref_etiq_marges_h);
// Label width
$w = round($preferences->pref_etiq_hsize);
// Label heigth
$h = round($preferences->pref_etiq_vsize);
// Line heigth
$line_h = round($h / 5);
$nb_etiq = 0;
foreach ($members as $member) {
    // Detect page breaks
    if ($nb_etiq % ($preferences->pref_etiq_cols * $preferences->pref_etiq_rows) == 0) {
        $pdf->AddPage();
    }
    // Set font
    $pdf->SetFont(Pdf::FONT, 'B', $preferences->pref_etiq_corps);
    // Compute label position
    $col = $nb_etiq % $preferences->pref_etiq_cols;
    $row = $nb_etiq / $preferences->pref_etiq_cols % $preferences->pref_etiq_rows;
    // Set label origin
    $x = $xorigin + $col * (round($preferences->pref_etiq_hsize) + round($preferences->pref_etiq_hspace));
    $y = $yorigin + $row * (round($preferences->pref_etiq_vsize) + round($preferences->pref_etiq_vspace));
    // Draw a frame around the label
    $pdf->Rect($x, $y, $w, $h);
    // Print full name
    $pdf->SetXY($x, $y);
    $pdf->Cell($w, $line_h, $member->sfullname, 0, 0, 'L', 0);
    // Print first line of address