Search
 
SCRIPT & CODE EXAMPLE
 

PHP

FPDF invoice Tutorial

<?php
/*call the FPDF library*/
require('fpdf.php');

	
/*A4 width : 219mm*/

$pdf = new FPDF('P','mm','A4');

$pdf->AddPage();
/*output the result*/

/*set font to arial, bold, 14pt*/
$pdf->SetFont('Arial','B',20);

/*Cell(width , height , text , border , end line , [align] )*/

$pdf->Cell(71 ,10,'',0,0);
$pdf->Cell(59 ,5,'Invoice',0,0);
$pdf->Cell(59 ,10,'',0,1);

$pdf->SetFont('Arial','B',15);
$pdf->Cell(71 ,5,'WET',0,0);
$pdf->Cell(59 ,5,'',0,0);
$pdf->Cell(59 ,5,'Details',0,1);

$pdf->SetFont('Arial','',10);

$pdf->Cell(130 ,5,'Near DAV',0,0);
$pdf->Cell(25 ,5,'Customer ID:',0,0);
$pdf->Cell(34 ,5,'0012',0,1);

$pdf->Cell(130 ,5,'Delhi, 751001',0,0);
$pdf->Cell(25 ,5,'Invoice Date:',0,0);
$pdf->Cell(34 ,5,'12th Jan 2019',0,1);
 
$pdf->Cell(130 ,5,'',0,0);
$pdf->Cell(25 ,5,'Invoice No:',0,0);
$pdf->Cell(34 ,5,'ORD001',0,1);


$pdf->SetFont('Arial','B',15);
$pdf->Cell(130 ,5,'Bill To',0,0);
$pdf->Cell(59 ,5,'',0,0);
$pdf->SetFont('Arial','B',10);
$pdf->Cell(189 ,10,'',0,1);



$pdf->Cell(50 ,10,'',0,1);

$pdf->SetFont('Arial','B',10);
/*Heading Of the table*/
$pdf->Cell(10 ,6,'Sl',1,0,'C');
$pdf->Cell(80 ,6,'Description',1,0,'C');
$pdf->Cell(23 ,6,'Qty',1,0,'C');
$pdf->Cell(30 ,6,'Unit Price',1,0,'C');
$pdf->Cell(20 ,6,'Sales Tax',1,0,'C');
$pdf->Cell(25 ,6,'Total',1,1,'C');/*end of line*/
/*Heading Of the table end*/
$pdf->SetFont('Arial','',10);
    for ($i = 0; $i <= 10; $i++) {
		$pdf->Cell(10 ,6,$i,1,0);
		$pdf->Cell(80 ,6,'HP Laptop',1,0);
		$pdf->Cell(23 ,6,'1',1,0,'R');
		$pdf->Cell(30 ,6,'15000.00',1,0,'R');
		$pdf->Cell(20 ,6,'100.00',1,0,'R');
		$pdf->Cell(25 ,6,'15100.00',1,1,'R');
	}
		

$pdf->Cell(118 ,6,'',0,0);
$pdf->Cell(25 ,6,'Subtotal',0,0);
$pdf->Cell(45 ,6,'151000.00',1,1,'R');


$pdf->Output();

?>
Comment

PREVIOUS NEXT
Code Example
Php :: array join pgp 
Php :: How To Force Redirect HTTP To HTTPS In Laravel Using ServiceProvider 
Php :: laravel count array 
Php :: select2 on modal 
Php :: text or description laravel database column type 
Php :: php get user county 
Php :: how to create constant in php 
Php :: download xampp php 7.3 
Php :: position for ip 
Php :: find object in array php 
Php :: object of class stdclass could not be converted to string php laravel 
Php :: php date 
Php :: import data from csv to db php 
Php :: sass download for windows 
Php :: display all files in a directory php 
Php :: laravel request input default value 
Php :: asin() php 
Php :: laravel collection combine 
Php :: woocommerce disable links on specific product 
Php :: how to get the size of an uploaded file in laravel 
Php :: php file_get_contents html with special characters 
Php :: Laravel check for constraint violation 
Php :: resize image using intervention laravel and save 
Php :: how remove column in migration laravel 
Php :: array_map in php 
Php :: How to Get Radio Button Value in PHP Without Submit 
Php :: how to change validation message in laravel 
Php :: install all php extensions ubuntu 20.04 
Php :: laravel https middleware 
Php :: php huruf besar di awal 
ADD CONTENT
Topic
Content
Source link
Name
8+1 =