picqer / php-barcode-generator

Barcode generator in PHP that is easy to use, non-bloated and framework independent.
GNU Lesser General Public License v3.0
1.66k stars 400 forks source link

Barcodes generated using BarcodeGeneratorDynamicHTML() do not render when printed #194

Closed objecttothis closed 5 months ago

objecttothis commented 5 months ago

In my function I have

$generator = new BarcodeGeneratorDynamicHTML();
$barcode_value = $this->get_barcode_value($item, $barcode_config);
return $generator->getBarcode($barcode_value, $barcode_config['barcode_type']);

Which properly generates the barcode. I needed to use this method because generating the PNG only allowed me to set a width factor and not an overall width in pixels and I needed all barcodes to have the same width regardless of their content.

The problem is that the barcode does not render when printed. I tried adding overflow:visible to the CSS, but this had no effect. Is there a way to force the print engine to render the <div> elements that make up the barcode?

casperbakker commented 5 months ago

This is not a problem from this library. This is just HTML/CSS rendering itself.