Thread: Output to PDF
View Single Post
Old 03-31-2009, 05:52 PM   #15 (permalink)
xenon
The Frequenter
Newcomer 
 
xenon's Avatar
 
Join Date: Dec 2007
Location: Bucharest, Romania
Posts: 438
Thanks: 3
xenon is on a distinguished road
Default

Here's some of my code, maybe it helps:

PHP Code:
$pdf = new FPDF('P''mm''A4');
        
$pdf->AddPage();
        
$pdf->SetFont('Arial','B'16);
        
$pdf->Cell(4010'Some title');
        
$pdf->Cell(-40);
        
$pdf->SetFont('Arial',''12);
        
$pdf->Cell(040'Field: 14');
        
$pdf->Cell(-190);
        
$pdf->Cell(055'Field: xx');
        
$pdf->Cell(-190);
        
$pdf->Cell(070'Field: 22');
        
$pdf->Cell(-190);
        
$pdf->Output('file_name.pdf''D'); 
I hope you get the main idea. You practically add "blocks" on top of each other. Remember that an A4 page has 298mm x 210mm. Remember to add the line height to each line you add.
__________________
I have optimistic thoughts, even though sometimes (if not always) life's a bitch.
xenon is offline  
Reply With Quote