[trick] Membuat Barcode di PDF dengan php mysql dan fpdf

Bismillah…

ok kali ini gw coba ngepost lagi y.. tutorial memuat barcode di pdf dengan php mysql dan fpdf add ons..

siapkan databases

databases

ok next masukan kodingannya..


<?php
mysql_connect("localhost","root","12345");
mysql_select_db("pdf");

$sql=mysql_query("select * from ktp where id='2'");
$data=mysql_fetch_array($sql);

$nama="$data[nama]";
$gambar=$data['foto'];

define('FPDF_FONTPATH', 'fpdf/font/');
require('code39.php');

$tgl = date('D,d-F-Y');

$pdf = new PDF_Code39();

$pdf->Open();
$pdf->addPage(L);

$pdf->setFont('Arial','',20);

$pdf->Image('foto/' . $gambar,10,10,80);

$pdf->Code39(100, 30, $nama);

//$pdf->Code39(100, 30, 'Test');

$pdf->Output();

?>

dan hasilnya :

hasilOk Mudah sekali bukan , silahkan download codingnnya disini

Leave a comment

5 Comments

  1. MasterMind

     /  08/01/2014

    Kok tetep ga bisa ya gan ?

    Reply
    • mungkin gini gan. sebelum buat barcodenya, download dulu library barcodenya , fpdf.org ada kok, atau agan bs download dari downloadtan diatas ada kok, udh ane sediain juga disitu

      Reply
  2. ndie

     /  16/01/2015

    code39.php nya dari mana ya

    Reply
  1. [share] Membuat Barcode di Codeigniter Dengan Component Zend Framework | menulis dibalik topi dan kopi

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: