예제 #1
0
    $fontsz = 8;
    $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');