$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; } $pdf->Cell($w, $line_h, $address, 0, 0, 'L', 0); // Print second line of address $pdf->SetXY($x, $y + $line_h * 2); $pdf->Cell($w, $line_h, $address_continuation, 0, 0, 'L', 0); // Print zip code and town $pdf->SetFont(Pdf::FONT, 'B', $preferences->pref_etiq_corps); $pdf->SetXY($x, $y + $line_h * 3); $pdf->Cell($w, $line_h, $zip . ' - ' . $town, 0, 0, 'L', 0); // Print country $pdf->SetFont(Pdf::FONT, 'I', $preferences->pref_etiq_corps); $pdf->SetXY($x, $y + $line_h * 4); $pdf->Cell($w, $line_h, $member->country, 0, 0, 'R', 0); $nb_etiq++; } // Send PDF code to browser $pdf->Output(_T("labels_print_filename") . '.pdf', 'D');
$pdf->SetFontSize($fontsz); while ($pdf->GetStringWidth($nom_adh_ext) > $max_text_size) { $fontsz--; $pdf->SetFontSize($fontsz); } $pdf->SetXY($x0 + 27, $pdf->getY() + 4); //$pdf->setX($x0 + 27); $pdf->writeHTML($nom_adh_ext, true, 0); // Email (adapt too) $fontsz = 6; $pdf->SetFontSize($fontsz); while ($pdf->GetStringWidth($email) > $max_text_size) { $fontsz--; $pdf->SetFontSize($fontsz); } $pdf->setX($x0 + 27); $pdf->writeHTML($email, false, 0); // Lower colored strip with long text $pdf->SetFillColor($fcol['R'], $fcol['G'], $fcol['B']); $pdf->SetTextColor($tcol['R'], $tcol['G'], $tcol['B']); $pdf->SetFont(Pdf::FONT, 'B', 6); $pdf->SetXY($x0, $y0 + 33); $pdf->Cell($w, 7, $preferences->pref_card_strip, 0, 0, 'C', 1); // Draw a gray frame around the card $pdf->Rect($x0, $y0, $w, $h); $nb_card++; } // Send PDF code to browser $session['pdf_error'] = false; $pdf->Output(_T("Cards") . '.pdf', 'D');