示例#1
0
         // set margins
         $pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
         $pdf->SetHeaderMargin(1);
         $pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
         // set auto page breaks
         $pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
         // set image scale factor
         $pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
         // ---------------------------------------------------------
         // set default font subsetting mode
         $pdf->setFontSubsetting(true);
         // Set font
         // dejavusans is a UTF-8 Unicode font, if you only need to
         // print standard ASCII chars, you can use core fonts like
         // helvetica or times to reduce file size.
         $pdf->SetFont('times', '', 11, '', true);
         // Add a page
         // This method has several options, check the source code documentation for more information.
         $pdf->AddPage();
         // set text shadow effect
         //$pdf->setTextShadow(array('enabled'=>true, 'depth_w'=>0.2, 'depth_h'=>0.2, 'color'=>array(196,196,196), 'opacity'=>1, 'blend_mode'=>'Normal'));
         // Set some content to print
         $html = <<<EOD
t<br>
t{$Today}<br>
t<br>
t{$Title} {$FirstName} {$FamilyName}<br>
t{$Company}<br>
t{$Address}<br>
t{$City} {$ZIP}<br>
t{$Country}<br>
示例#2
0
    case 'ITA':
        $created = 'Creato il ';
        $sender = 'Mittente:								';
        $recipient = 'Destinatario:	';
        $date = 'Data:														';
        $title = 'Titolo:												';
        $page = 'Pagina';
        break;
    default:
        $created = 'Created on ';
        $sender = 'Sender:							';
        $recipient = 'Recipient:			';
        $date = 'Date:											';
        $title = 'Title:												';
        $page = 'Page';
        break;
}
$pdf = new myPDF();
$pdf->SetFooterData($config['site_url'], $page);
$pdf->Open();
$pdf->SetAuthor($game->player['user_name']);
$pdf->SetTitle($config['site_url']);
$pdf->SetAutoPageBreak(true, 15.0);
$pdf->AddPage();
$pdf->SetFont('Arial', 'I', 8);
$pdf->MultiCell(0, 7, $created . date('d.m.y H:i', time()) . '', 0, 'R');
$pdf->SetFont('Arial', 'B', 16);
$pdf->MultiCell(0, 7, '' . $pdf->MultiCell(0, 7, $sender . $sendername['user_name']), $pdf->MultiCell(0, 7, $recipient . $game->player['user_name']), $pdf->MultiCell(0, 7, $date . $time), $pdf->MultiCell(0, 7, $title . $subject));
$pdf->Ln();
$pdf->MultiCell(0, 7, $text, 1);
$pdf->Output();
示例#3
0
        $this->SetFont('Times', '', 12);
        $w = $this->GetStringWidth($title) + 150;
        $this->SetDrawColor(0, 0, 180);
        $this->SetFillColor(230, 0, 230);
        $this->SetTextColor(0, 0, 255);
        $this->SetLineWidth(1);
        $this->Cell($w, 9, $title, 1, 1, 'C', 1);
        $this->Ln(10);
    }
    //Page footer
    function Footer()
    {
        //Position at 1.5 cm from bottom
        $this->SetY(-15);
        $this->SetFont('Arial', 'I', 8);
        $this->Cell(0, 10, 'This is the page footer -> Page ' . $this->PageNo() . '/{nb}', 0, 0, 'C');
    }
}
$title = "FPDF Library Page Header";
$pdf = new myPDF('P', 'mm', 'Letter');
$pdf->AliasNbPages();
$pdf->AddPage();
$pdf->SetFont('Times', '', 24);
$pdf->Cell(0, 0, 'some text at the top of the page', 0, 0, 'L');
$pdf->ln(225);
$pdf->Cell(0, 0, 'More text toward the bottom', 0, 0, 'C');
$pdf->AddPage();
$pdf->SetFont('Arial', 'B', 15);
// Cell(W, H, 'text', Border, Return, 'Allign') - basic syntax
$pdf->Cell(0, 0, 'Top of page 2 after header', 0, 1, 'C');
$pdf->Output();
$pdf->AliasNbPages();
$pdf->AddPage();
$pdf->SetY(35);
$pdf->BuildTable1($header1, $data1);
$pdf->SetY(55);
$pdf->BuildTable($header, $data);
$pdf->Ln(6);
$substring = " Total Subtotal: \$" . $subtotal . " ";
$substrwidth = $pdf->GetStringWidth($substring);
$substrX = 260 - $substrwidth;
$pdf->SetX($substrX);
$pdf->Cell($substrwidth, 6, $substring, 1, 1, 'C');
$tax = $subtotal * 0.075;
$tax = round($tax, 2);
$tax = number_format((double) $tax, 2, '.', '');
$taxstring = " Tax (7.5%): \$" . $tax . " ";
$taxstrwidth = $pdf->GetStringWidth($taxstring);
$taxstrX = 260 - $taxstrwidth;
$pdf->SetX($taxstrX);
$pdf->Cell($taxstrwidth, 6, $taxstring, 1, 1, 'C');
$pdf->SetFont('', 'B', 12);
$grandtotal = $tax + $subtotal;
$grandtotal = round($grandtotal, 2);
$grandtotal = number_format((double) $grandtotal, 2, '.', '');
$grandtotalstring = " Grand Total: \$" . $grandtotal . " ";
$grandtotstrwidth = $pdf->GetStringWidth($grandtotalstring);
$grandtotstrX = 260 - $grandtotstrwidth;
$pdf->SetX($grandtotstrX);
$pdf->Cell($grandtotstrwidth, 6, $grandtotalstring, 1, 1, 'C');
$pdf->Output();
$conn = null;
示例#5
0
}
function saison()
{
    $annee = intval(date("Y"));
    $mois = intval(date("m"));
    if ($mois < 7) {
        $annee = $annee - 1;
    }
    $annee2 = $annee + 1;
    return "{$annee}/{$annee2}";
}
$pdf = new myPDF('P', 'mm', 'A4');
$pdf->SetMargins(20, 15);
$pdf->AddPage();
$pdf->image("../logoaikido.png", 20, 10, 28.1);
$pdf->SetFont('Helvetica', 'B', 28);
$pdf->Text(89, 15, iconv('UTF-8', 'windows-1252', 'AÏKIDO'));
$pdf->Text(65, 25, 'Saint Cyr Club 78');
$pdf->SetFontSize(18);
$pdf->Text(90, 35, '(ASCC78)');
$pdf->Text(75, 50, 'FICHE D\'INSCRIPTION');
$pdf->Text(78, 57, 'SAISON ' . saison());
$pdf->SetFont('Arial', '', 11);
$pdf->SetXY(20, 70);
$pdf->ecrire("Nom: ");
$pdf->getValue("nom");
$pdf->SetX(88);
$pdf->ecrire("Prénom: ");
$pdf->getValue("prenom");
$pdf->SetX(140);
$pdf->ecrire("Sexe: ");
 //---------------------------------------
 //y-Position setzten
 $pdf->SetY(25);
 //Setzten des Teenstreets Logo
 $pdf->SetX(20);
 $pdf->Image("images/MN_Logo_kleiner.png", $pdf->GetX(), $pdf->GetY(), 60, 20, 'png', 'http://www.mission-net.org');
 //Zweites Logo
 $pdf->SetY(25);
 $pdf->SetX(135);
 $pdf->Image("images/MN_Logo_kleiner.png", $pdf->GetX(), $pdf->GetY(), 60, 20, 'png', 'http://www.mission-net.org');
 //Linie
 $pdf->setLineWidth(1);
 $pdf->Line(20, 45, 195, 45);
 //Cell, Anmeldung gueltig
 $pdf->SetY(50);
 $pdf->SetFont('Arial', 'B', 10);
 $pdf->Cell(0, 1, T_("Please print this page, sign it and send it to us, if you are under 18 years."), 0, 0, 'R');
 //#################HEADER END############
 //#################Mission-Net ADDRESS#######
 $pdf->SetX(20);
 $pdf->SetY(55);
 $pdf->SetFont('Arial', 'B', 12);
 $pdf->Write(5, "Mission-Net", 0, 'L');
 $pdf->ln();
 $pdf->Write(5, "Registration", 0, 'L');
 $pdf->ln();
 $pdf->Write(5, "Alte Neckarelzerstr. 2", 0, 'L');
 $pdf->ln();
 $pdf->Write(5, "D-74821 Mosbach", 0, 'L');
 $pdf->ln();
 $pdf->Write(5, "Germany", 0, 'L');