예제 #1
0
 // 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
 $pdf->SetFont(Pdf::FONT, '', $preferences->pref_etiq_corps);
 $pdf->SetXY($x, $y + $line_h);
 //if member address is missing but there is a parent,
 //take the parent address
 $address = $member->address;
 $address_continuation = $member->address_continuation;
 $zip = $member->zipcode;
 $town = $member->town;
 if (empty($address) && $member->hasParent()) {
     $address = $member->parent->address;
     $address_continuation = $member->parent->address_continuation;
     $zip = $member->parent->zipcode;
     $town = $member->parent->town;
예제 #2
0
         $fcol = $hcol;
         break;
     default:
         $fcol = $scol;
 }
 $id = '<strong>' . $member->id . '</strong>';
 $nom_adh_ext = '<strong>' . ($preferences->pref_bool_display_title ? $member->stitle . ' ' : '') . $member->sname . '</strong>';
 $photo = $member->picture;
 $photofile = $photo->getPath();
 // Photo 100x130 and logo
 $pdf->Image($photofile, $x0, $y0, 25);
 $pdf->Image($logofile, $xl, $y0, round($wlogo));
 // Color=#8C8C8C: Shadow of the year
 $pdf->SetTextColor(140);
 $pdf->SetFontSize($year_font_size);
 $pdf->SetXY($x0 + 65, $y0 + $hlogo);
 $pdf->writeHTML($an_cot, false, 0);
 // Colored Text (Big label, id, year)
 $pdf->SetTextColor($fcol['R'], $fcol['G'], $fcol['B']);
 $pdf->SetFontSize(8);
 $pdf->SetXY($x0 + 69, $y0 + 28);
 $pdf->writeHTML($id, false, 0);
 $pdf->SetFontSize($year_font_size);
 $pdf->SetXY($x0 + 64.7, $y0 + $hlogo - 0.3);
 $pdf->writeHTML($an_cot, false, 0);
 // Abbrev: Adapt font size to text length
 $fontsz = 12;
 $pdf->SetFontSize($fontsz);
 while ($pdf->GetStringWidth($abrev) > $max_text_size) {
     $fontsz--;
     $pdf->SetFontSize($fontsz);