Prepped barcode for being able to be set by width.

This commit is contained in:
objecttothis
2024-04-01 19:31:41 +04:00
committed by jekkos
parent 21c84efd2d
commit 34246ee885
2 changed files with 8 additions and 2 deletions

View File

@@ -151,10 +151,10 @@ class Barcode_lib
{
if((isset($item['item_number']) || isset($item['name'])) && isset($item['item_id']))
{
$barcode = $this->generate_barcode($item, $barcode_config);
$display_table = '<table>';
$display_table .= '<tr><td style="text-align:center;">' . $this->manage_display_layout($barcode_config['barcode_first_row'], $item, $barcode_config) . '</td></tr>';
$barcode = $this->generate_barcode($item, $barcode_config);
$display_table .= '<tr><td style="text-align:center;"><div style=\'height:' . $barcode_config['barcode_height'] . 'px; width:'. $barcode_config['barcode_width'] . "px'>$barcode</div></td></tr>";
$display_table .= "<tr><td style='text-align:center;'><div class='barcode'>$barcode</div></td></tr>";
$display_table .= '<tr><td style="text-align:center;">' . $this->manage_display_layout($barcode_config['barcode_second_row'], $item, $barcode_config) . '</td></tr>';
$display_table .= '<tr><td style="text-align:center;">' . $this->manage_display_layout($barcode_config['barcode_third_row'], $item, $barcode_config) . '</td></tr>';
$display_table .= '</table>';

View File

@@ -17,6 +17,12 @@ $barcode_lib = new Barcode_lib();
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title><?= lang('Items.generate_barcodes') ?></title>
<link rel="stylesheet" rev="stylesheet" href="<?= base_url() ?>css/barcode_font.css" />
<style>
.barcode svg {
height: <?= $barcode_config['barcode_height'] ?>px;
width: <?= $barcode_config['barcode_width'] ?>px;
}
</style>
</head>
<body class=<?= "font_" . $barcode_lib->get_font_name($barcode_config['barcode_font']) ?>