<?php
session_start();
require('../fpdf/code128.php');
$code=$_POST['barcodevalue'];
$widthbr=$_POST['widthbr'];
$heightbr=$_POST['heightbr'];
$noofcopybr=$_POST['noofcopybr'];
$productcode=$_POST['productcode'];
$category=$_POST['cat'];
$qty=$_POST['qty'];
$MRP=$_POST['MRP'];
$size=$_POST['Size'];
$styleno=$_POST['styleno'];
$color=$_POST['color'];
$fit=$_POST['fit'];


$pdf=new PDF_Code128('L','mm',array($widthbr,$heightbr));
//$pdf=new PDF_Code128('L','mm',array(80.9,50.8));


$k=1;
for ($i = 0; $i < count($_POST['barcodevalue']); $i++) 
{
  for ($j = 0; $j < $qty[$i]; $j++)
  { 
  
if ($k == 1){
$pdf->AddPage();
$k=2;
$xp=5;
}
else {
$k=1;
$xp=40;}	
  $pdf->Generate_Barcode($code[$i],$noofcopybr,$productcode[$i],$MRP[$i],$category[$i],$size[$i],$styleno[$i],$color[$i],$fit[$i],$k,$xp);
  
  }
}


//$pdf->Generate_Barcode($code,1);
//$pdf->Generate_Barcode($code,120,80,30);
//$pdf->Generate_Barcode($code);
//$pdf->Generate_Barcode($code);


//A set



$pdf->Output('barcodeoutput.pdf', 'F');
?>
