sarabitcom / fpdf-barcode
library to generate pdf document with barcode support
1.0.1
2021-10-24 11:05 UTC
This package is auto-updated.
Last update: 2025-05-24 18:54:30 UTC
README
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');