Error barcode.php function while gero PDF with MPDF

2

I am in a project at the company to send the ticket from here automatically to the email of the customers. The fact is that the layout and boleto are already working perfectly. The only problem is that when I convert the ticket to pdf automatically, it gives the following error:

  

"Warning: Can not modify header information - headers already sent by C: \ wamp \ www \ siclop-send_boleto \ pdf \ mpdf.php on line 8297 "   "C: \ wamp \ www \ siclop-send_boleto \ pdf \ mpdf.php" C: \ wamp \ www \ siclop-send_boleto \ pdf \ mpdf.php on line 1706 "

I am using mPDF and this error only happens when I call the function to generate the barcode. When I do not call this function, it shows me the formatted pdf but obviously it does not show me the barcode (only the digitable line). I do not know why he does not understand the bar code. I have seen that in mPDF itself has a class called barcode.php ; I do not know if it accepts the barcode only using this class ...

I wonder if you can help me with this error or if you have any suggestions on how I can be doing this conversion to pdf? The code for the barcode generation function is this:

<?php 
function fbarcode($valor){

$fino = 1 ;
$largo = 3 ;
$altura = 50 ;

  $barcodes[0] = "00110" ;
  $barcodes[1] = "10001" ;
  $barcodes[2] = "01001" ;
  $barcodes[3] = "11000" ;
  $barcodes[4] = "00101" ;
  $barcodes[5] = "10100" ;
  $barcodes[6] = "01100" ;
  $barcodes[7] = "00011" ;
  $barcodes[8] = "10010" ;
  $barcodes[9] = "01010" ;
  for($f1=9;$f1>=0;$f1--){ 
    for($f2=9;$f2>=0;$f2--){  
      $f = ($f1 * 10) + $f2 ;
      $texto = "" ;
      for($i=1;$i<6;$i++){ 
        $texto .=  substr($barcodes[$f1],($i-1),1) . substr($barcodes[$f2],($i-1),1);
      }
      $barcodes[$f] = $texto;
    }
  }
//Desenho da barra
//Guarda inicial
?><img src=img/p.png width=<?php echo $fino?> height=<?php echo $altura?> border=0><img 
src=img/b.png width=<?php echo $fino?> height=<?php echo $altura?> border=0><img 
src=img/p.png width=<?php echo $fino?> height=<?php echo $altura?> border=0><img 
src=img/b.png width=<?php echo $fino?> height=<?php echo $altura?> border=0><img 
<?php
$texto = $valor ;
if((strlen($texto) % 2) <> 0){
    $texto = "0" . $texto;
}
// Draw dos dados
while (strlen($texto) > 0) {
  $i = round(esquerda($texto,2));
  $texto = direita($texto,strlen($texto)-2);
  $f = $barcodes[$i];
  for($i=1;$i<11;$i+=2){
    if (substr($f,($i-1),1) == "0") {
      $f1 = $fino ;
    }else{
      $f1 = $largo ;
    }
?>
    src=img/p.png width=<?php echo $f1?> height=<?php echo $altura?> border=0><img 
<?php
    if (substr($f,$i,1) == "0") {
      $f2 = $fino ;
    }else{
      $f2 = $largo ;
    }
?> src=img/b.png width=<?php echo $f2?> height=<?php echo $altura?> border=0><img 
<?php
  }
}
// Draw guarda final
?>src=img/p.png width=<?php echo $largo?> height=<?php echo $altura?> border=0><img 
src=img/b.png width=<?php echo $fino?> height=<?php echo $altura?> border=0><img 
src=img/p.png width=<?php echo 1?> height=<?php echo $altura?> border=0>  
?>
    
asked by anonymous 07.07.2015 / 16:04

0 answers