require_once( 'tcpdf.php' );
$pdf = new TCPDF( 'P' , 'mm' , 'A4' , true , 'UTF-8' , false );
$pdf->SetCreator( 'Helloweba' );
$pdf->SetAuthor( 'yueguangguang' );
$pdf->SetTitle( 'Welcome to helloweba.com!' );
$pdf->SetSubject( 'TCPDF Tutorial' );
$pdf->SetKeywords( 'TCPDF, PDF, PHP' );
$pdf->SetHeaderData( 'logo.png' , 30 , 'Helloweba.com' , '致力于WEB前端技术在中国的应用' ,
array( 0 , 64 , 255 ), array( 0 , 64 , 128 ));
$pdf->setFooterData(array( 0 , 64 , 0 ), array( 0 , 64 , 128 ));
$pdf->setHeaderFont( Array ( 'stsongstdlight' , '' , '10' ));
$pdf->setFooterFont( Array ( 'helvetica' , '' , '8' ));
$pdf->SetDefaultMonospacedFont( 'courier' );
$pdf->SetMargins( 15 , 27 , 15 );
$pdf->SetHeaderMargin( 5 );
$pdf->SetFooterMargin( 10 );
$pdf->SetAutoPageBreak(TRUE, 25 );
$pdf->setImageScale( 1.25 );
$pdf->setFontSubsetting( true );
$pdf->SetFont( 'stsongstdlight' , '' , 14 );
$pdf->AddPage();
$str1 = '欢迎来到Helloweba.com' ;
$pdf->Write( 0 ,$str1, '' , 0 , 'L' , true , 0 , false , false , 0 );
$pdf->Output( 't.pdf' , 'I' );
|