kreativekorp / barcode

barcode.php - Generate barcodes from a single PHP file. MIT license.
MIT License
258 stars 136 forks source link

hide text in barcode #6

Open ghost opened 5 years ago

ghost commented 5 years ago

I want to hide barcode text in bottom. Only barcode should display....how to do that?

gubi commented 5 years ago

See also the relative merge request

ZHTEKDev commented 4 months ago

//Remove the text below the barcode:

`<?php class barcode_generator { public function output_image($format, $symbology, $data, $options) { switch (strtolower(preg_replace('/[^A-Za-z0-9]/', '', $format))) { case 'png': header('Content-Type: image/png'); $image = $this->render_image($symbology, $data, $options); // Remove the text rendering part $image = preg_replace('/<text.<\/text>/', '', $image); echo $image; break; case 'svg': header('Content-Type: image/svg+xml'); $svg = $this->render_svg($symbology, $data, $options); // Remove the text rendering part $svg = preg_replace('/<text.<\/text>/', '', $svg); echo $svg; break; default: return false; } }

// Other methods...

}`