Re: Problem with Bar codes on reports pdf app (URGENT)
Hi, thanks for answer.
I try with C:DataSistemasSitiosWebIntranetpdfpdf_cerpdf_cer_grid.class.php
But it’s the same, the error ramains (just when I select barcode type).
The file exists, and the code is this:
Before the line 501:
$this->codigo_barras[$this->nm_grid_colunas] = trim($this->codigo_barras[$this->nm_grid_colunas]);
if (empty($this->codigo_barras[$this->nm_grid_colunas]) || $this->codigo_barras[$this->nm_grid_colunas] == "none" || $this->codigo_barras[$this->nm_grid_colunas] == "*nm*")
{
$this->codigo_barras[$this->nm_grid_colunas] = "" ;
$out_codigo_barras = "" ;
}
else
{
$Font_bar = new BCGFont($this->Ini->path_third . '/barcodegen/class/font/Arial.ttf', 8);
$Color_black = new BCGColor(0, 0, 0);
$Color_white = new BCGColor(255, 255, 255);
$out_codigo_barras = $this->Ini->path_imag_temp . "/sc_code39extended_" . $_SESSION['scriptcase']['sc_num_img'] . session_id() . ".gif";
$_SESSION['scriptcase']['sc_num_img']++ ;
$this->codigo_barras[$this->nm_grid_colunas] = (string) $this->codigo_barras[$this->nm_grid_colunas];
$Code_bar = new BCGcode39extended();
$Code_bar->setScale(1);
$Code_bar->setThickness(30);
$Code_bar->setForegroundColor($Color_black);
$Code_bar->setBackgroundColor($Color_white);
$Code_bar->setFont($Font_bar);
$Code_bar->setChecksum(false);
$Code_bar->parse($this->codigo_barras[$this->nm_grid_colunas]);
$Drawing_bar = new BCGDrawing($this->Ini->root . $out_codigo_barras, $Color_white);
$Drawing_bar->setBarcode($Code_bar);
$Drawing_bar->setDPI(72);
$Drawing_bar->draw();
$Drawing_bar->finish(BCGDrawing::IMG_FORMAT_GIF);
}
The line 501 is just: else
and after the line (the code of that else)
{
$this->codigo_barras[$this->nm_grid_colunas] = nl2br($this->codigo_barras[$this->nm_grid_colunas]) ;
$temp = explode("<br />", $this->codigo_barras[$this->nm_grid_colunas]);
if (!isset($temp[1]))
{
$temp = explode("<br>", $this->codigo_barras[$this->nm_grid_colunas]);
}
$this->codigo_barras[$this->nm_grid_colunas] = "" ;
$ind_x = 0 ;
while (isset($temp[$ind_x]))
{
if (!empty($this->codigo_barras[$this->nm_grid_colunas]))
{
$this->codigo_barras[$this->nm_grid_colunas] .= "<br>";
}
if (strlen($temp[$ind_x]) > 50)
{
$this->codigo_barras[$this->nm_grid_colunas] .= wordwrap($temp[$ind_x], 50, "<br>");
}
else
{
$this->codigo_barras[$this->nm_grid_colunas] .= $temp[$ind_x];
}
$ind_x++;
}
}
I don’t know what happens…