5
0
mirror of https://github.com/cwinfo/php-barcode.git synced 2024-12-22 18:35:39 +00:00

Update README.md

This commit is contained in:
Rebecca G. Bettencourt 2023-02-20 23:29:36 -08:00 committed by GitHub
parent 010bb1ef92
commit fced16a840
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -13,16 +13,28 @@ include 'barcode.php';
$generator = new barcode_generator();
/* Output directly to standard output. */
header("Content-Type: image/$format");
$generator->output_image($format, $symbology, $data, $options);
/* Create bitmap image. */
/* Create bitmap image and write to standard output. */
header('Content-Type: image/png');
$image = $generator->render_image($symbology, $data, $options);
imagepng($image);
imagedestroy($image);
/* Generate SVG markup. */
/* Create bitmap image and write to file. */
$image = $generator->render_image($symbology, $data, $options);
imagepng($image, $filename);
imagedestroy($image);
/* Generate SVG markup and write to standard output. */
header('Content-Type: image/svg+xml');
$svg = $generator->render_svg($symbology, $data, $options);
echo $svg;
/* Generate SVG markup and write to file. */
$svg = $generator->render_svg($symbology, $data, $options);
file_put_contents($filename, $svg);
```
Use with GET or POST: