Line 37:
Line 37:
= Code PHP =
= Code PHP =
−
Pour générer une image d'un bar code ou d'un QR code, vous pouvez utiliser la portion de code suivant:
+
Pour générer une image d'un code barre ou d'un QR code, vous pouvez utiliser la portion de code suivant:
<syntaxhighlight lang="php">
<syntaxhighlight lang="php">
−
$code = 'string_to_convert_into_qrcode';
+
$code = 'string_to_convert_into_image';
−
$generator = 'tcpdfbarcode'; // Can be 'phpbarcode' or a value provided by an external module
+
$generator = 'tcpdfbarcode'; // Can be 'tcpdfbarcode', 'phpbarcode', a value provided by an external module, ...
−
$encoding = 'QRCODE';
+
$encoding = 'QRCODE'; // Can be 'QRCODE', 'EAN13', ...
$dirbarcode = array_merge(array("/core/modules/barcode/doc/"), $conf->modules_parts['barcode']);
$dirbarcode = array_merge(array("/core/modules/barcode/doc/"), $conf->modules_parts['barcode']);