Skip to content

library to generate pdf document with bar-code support

Notifications You must be signed in to change notification settings

sarabitcom/fpdf-barcode

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

fpdf-barcode

library to generate pdf document with bar-code support

Create Object

 $pdf = new \Sarabitcom\Fpdf\FpdfCode39('P', 'mm', 'A4');          

Set Margins

  $pdf->SetLeftMargin(68);
  $pdf->SetRightMargin(1);
  $pdf->SetTopMargin(90);

Add Page

  $pdf->AddPage();
 

Set Headers (Optional)

$pdf->SetAuthor('You Name');
$pdf->SetCreator('Sarabit PDF Barcode');
$pdf->SetTitle('Document Title');
$pdf->SetSubject('Document Subject');

Add Barcode

 $pdf->Code39(138, 160, "1234567890", 1, 10);

Set Image

$imagePath = "/home/user/yourimage.jpeg"; // Absolute Path
$pdf->Image($imagePath, 0, 0, 210, 297);

Set Font

// Normal
$pdf->SetFont('Times', '', 12);
// Bold
$pdf->SetFont('Times', 'B', 11);
// Italic
$pdf->SetFont('Times', 'I', 11);

Make Cell

$pdf->Text(68, 164, "Your Text Here");

Output

$pdf->Output('file.pdf', 'I');

About

library to generate pdf document with bar-code support

Resources

Stars

Watchers

Forks

Packages

No packages published