All pastes #2044843 Raw Edit

Something

public text v1 · immutable
#2044843 ·published 2011-04-11 12:52 UTC
rendered paste body
//require_once(dirname(__FILE__).'/tcpdf/config/lang/eng.php');
		require_once(BASEPATH.'lib/tcpdf/tcpdf.php');
		
		// create new PDF document
		$pdf = new TCPDF('' , PDF_UNIT, C , true , 'UTF-8' , false); 
		
		// set document information
		//$pdf->SetCreator('SO-youth');
		
		// remove default header/footer
		$pdf->setPrintHeader(false);
		$pdf->setPrintFooter(false);
		
		// set default monospaced font
		$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
		
		//set margins
		$pdf->SetMargins(0, 0, 0);
		
		//set auto page breaks
		$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
		
		//set image scale factor
		$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO); 
		
		// set font
		$pdf->SetFont('courier', '', 10);
		
		// add a page
		$pdf->AddPage('', array(53.98 , 85.6));
		
		// set JPEG quality
		$pdf->setJPEGQuality(100);
		
		$cred = <<<EOT
			<p>
				<b>Happy Singh</b><br/>
				<span style="font-size: 80%;">Bubong</span>
			</p>
EOT;
		$id = <<<EOT
			<span style="font-size: 60%;">khataakkkk</span>
EOT;
		
		$pdf->Image( APPPATH.'res/card_templates/studentf.jpg', 0 , 0 , 85.6 , 53.98 , 'jpeg' , null , null , false , 300 , '' , false , false , 0 , true , false , false );
		
		// add a page
		//$pdf->AddPage();
		
		//$pdf->Image( APPPATH.'res/card_templates/studentb.jpg', 0 , 0 , 85.6 , 53.98 , null , null , null , false , 300 );
		
		//$pdf->writeHTMLCell(60, 15, 50.5, 20.5, $cred);
		//$pdf->writeHTMLCell(50, 20, 77, 50.5, $id);
		
		//Close and output PDF document
		$pdf->Output('tango.pdf' , 'I');