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.67k stars 402 forks source link

detect barcode type from given string #116

Closed arcanisgk closed 3 years ago

arcanisgk commented 3 years ago

mpdf need barcode type in string to print the barcode.

php-barcode-generator can retrive this information from given barcode string???

https://mpdf.github.io/reference/html-control-tags/barcode.html

casperbakker commented 3 years ago

No, that is not possible by no one. Because a barcode type is not about the text inside the barcode, but about the encoding from text to bars. The string ‘abc’ is valid in all barcode types that are not integer-only.

You can choose code128 as this is the type that has support for the most chars and is variable in length.