Пример #1
0
 class myPDF extends TCPDF
 {
     public function Footer()
     {
         $this->SetY(-15);
         $this->SetColor('text', 23, 54, 93, false, '');
         $this->Cell(180, 0, '5-108 SEIEE BUILDINGS, SHANGHAI JIAO TONG UNIVERSITY,', 0, 1, 'C', false, '', 0);
         $this->Cell(180, 0, '800 DONGCHUAN ROAD, MINHANG, SHANGHAI 200240, CHINA', 0, 1, 'C', false, '', 0);
         $this->Cell(180, 0, 'Phone: +86 2134208259 Email: info@acp-conf.org www.acp-conf.org', 0, 1, 'C', false, '', 0);
     }
 }
 // create new PDF document
 $pdf = new myPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
 $fontname = $pdf->addTTFfont('font/arial.ttf', 'TrueTypeUnicode', '', 32);
 // set document information
 $pdf->SetCreator('2014 ACP Committee');
 $pdf->SetAuthor('2014 ACP Committee');
 $pdf->SetTitle('Invitation Letter');
 $pdf->SetSubject('');
 $pdf->SetKeywords('');
 // set default header data
 $pdf->SetHeaderData('header.jpg', PDF_HEADER_LOGO_WIDTH, '' . '', '', array(255, 255, 255), array(255, 255, 255));
 $pdf->setFooterData(array(23, 54, 93), array(255, 255, 255));
 // set header and footer fonts
 $pdf->setHeaderFont(array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
 $pdf->setFooterFont(array($fontname, '', PDF_FONT_SIZE_DATA));
 // set default monospaced font
 $pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
 // set margins
 $pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
 $pdf->SetHeaderMargin(1);
 ///*DEBUG
 //print_r($data);
 $var_prename = $data["firstname"];
 $var_familyname = $data["lastname"];
 $var_street = $data["street"];
 $var_plz = $data["plzort"]["postcode"];
 $var_city = $data["plzort"]["city"];
 // Find out what type of participant we are dealing with (normal=1, Service Team.....)
 $pdf = new myPDF('P', 'mm', 'A4');
 //A4, mm und Hochformat
 $pdf->AddPage();
 //Neue Seite Hinzufuegen
 $pdf->SetLeftMargin(20);
 //linker Rand 20 mm
 $pdf->SetAuthor("Mission-Net");
 $pdf->SetCreator("Mission-Net");
 $st_pdf_keywords = 'Reg.-No.: ' . $var_registrationnr;
 $pdf->SetKeywords($st_pdf_keywords);
 $pdf->SetSubject("Mission-Net Registration");
 $pdf->SetTitle("Registration for Mission-Net 2009");
 //######################HEADER###########
 //---------------------------------------
 //      Information und Logo
 //---------------------------------------
 //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);