简体   繁体   中英

Add barcode in Form Fillable PDF

I have implemented following code which fills the fields within PDF. I am using http://www.fpdf.org/en/script/script93.php for filling PDF form.

Now i want to add the barcode in to pdf. For creating barcode i am using https://github.com/davidscotttufts/php-barcode/ .

  <?php 

  require('fpdm.php'); 

  $useName = "User-Name";
  $barCode = '<img alt="testing" src="barcode.php?text='.$useName.'" />';

  $fields = array(
'name'    => 'UserName',
'address' => 'Address Here',
'city'    => 'City Here',
'phone'   => '999999999'
  );


 $pdf = new FPDM('userFormPdf.pdf'); 
 $pdf->Load($fields, false);  
 $pdf->Merge(); 
 $pdf->Output();

 ?>

I just want to add the barcode in pdf file. Does any one have idea how to do it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM