Coder Social home page Coder Social logo

kreativekorp / barcode Goto Github PK

View Code? Open in Web Editor NEW
246.0 16.0 132.0 48 KB

barcode.php - Generate barcodes from a single PHP file. MIT license.

License: MIT License

HTML 73.62% PHP 26.38%
barcode barcodes linear-barcodes matrix-barcodes barcode-generator upc upc-a upc-e ean ean8

barcode's People

Contributors

cwchristerw avatar rebeccargb avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

barcode's Issues

Multiple fnc1 in ean128 support

First, Thank you for this great library.

I edited your code and add fnc1 to show multiple piece of data in one barcode. But before the special character (fnc1) when the numbers are even it works. When the number is odd, it shows (24) instead of 8. (Ascii code) . Can you please help me to solve this issue

breaks by using --> * <-- for check Digit

Hallo,

/* Replace * with missing or check digit. /
->(-) while (($o = st(rr)pos($data, '
')) !== false) {
->(+) while (($o = st(r)pos($data, '*')) !== false) {

->(-) for ($i = 0; $i < 13; $i++) {
->(+) for ($i = 0; $i < ($o or 12); $i++) {

breaks by --> * <--
for ($i = 0; $i < (-->13<--); $i++) {
0 1 2 3 4 5 6 7 8 9 10 11 *
" < 13 must be < 12 "

or with while loop: use --> " < $o " <--:
if there is more than one --> * <--
search with --> st(r)pos(...) <-- for first occurrence and
use --> " < $o instead < 12 " <-- for position

I can't scan the ean 13 code

I can't scan the produced ean-13 barcode. This is my code:

`include 'barcode.php';

$format = 'png';
$symbology = 'ean-13-pad';
$data = '978020137963';
$options = '';

$generator = new barcode_generator();

$name = "test";

/* Create bitmap image. */

$image = $generator->render_image($symbology, $data, $options);
header( "Content-type: image/png" );
imagepng($image);
$save = strtolower($name) .".png";
chmod($save,0755);
imagepng($image, $save, 0, NULL);
imagedestroy($image);
`

Member function on null

I'm doing this:

include('barcode.php');
$generator = new barcode_generator();
$svg = $generator->render_svg('code-128', '13123');
echo $svg;

And I'm getting this error:
Uncaught Error: Call to a member function render_svg() on null
If I do a var_dump($generator); just get NULL

Аztec format generation

Good evening.

Not so long ago, I accidentally discovered your script for creating barcodes: https://github.com/kreativekorp/barcode
He is simply the best !!! I spent a lot of time searching, better than your script simply does not exist!
Very happy, very convenient to use, works very reliable and good!

There is only one wish. Please, maybe you could add aztec format generation to your script ?! This format is gaining popularity, and nowhere on the Internet is there an implementation of this format in the PHP language.
Please, if possible, add support for this format in your super cool script!

Mikhail Isaev (Belarus)

hide text in barcode

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

¿How to decode this?

I love this library, but it would be ideal that just as QR can be created in thousands of possibilities, it would be just as fair if it could be decoded.

how to save barcode img

Hello, how can I save generated barcode as image into file? Is this possible? Or Can I use generated barcode with dompdf? Thank you.

Text and barre code different

HI,

I would like make barre code with 1PUSBRS485F1.8M but only write USBRS485F1.8M texte ?

Is it possiblz to make that ?

Thank by advance
Eric

First of all thank you for the great library. I am having a problem generating image file

First and foremost, it's a great library - Thank you.

I am having a bit problem.

When I call the barcode.php file using GET or POST: i.e. https://..../barcode.php?f=png&s=upc-a&d=213...410945 I am getting the png image. All looks good.

However, when I try to create an image (png, gif or jpg) using:
$image = $generator->render_image($symbology, $data, $options);
imagepng($image);
imagedestroy($image);

I get this: "�PNG � IHDR�d������ pHYs������+���-IDATx����n�0EQ\����}��8� ���ZR���0��0)��:A�����}DA��A��Q�DA��A��Q��FQJ��پ�u��g�[n{v���Ό{�xG�_[w�=[�5�Q�"

I did some reading and it looks like this issue could possibly be due to [UTF8 BOM] output. And I am not sure how to get No-BOM UTF8 output.

I would much appreciate any help.

Thank you in advance.

Kind regards.

file extension

When i want to download my barcode its downloading as barcode.PHP. so this file extension may not effect us but there are other people who don't know how to change file extension. so add this line inside function output_image
for example:
case "png":
header('Content-Disposition: attachment; filename="anything.png"');

width, height image problem

How to set width and height image. I try to set &w and &h params and don't work.

Examples:

<img src="barcode.php?f=png&s=ean-13&d=1111111111111&w=113&h=56" />
<img src="barcode.php?f=png&s=ean-13&d=1111111111111&w=113&h=56" width="113" height="56" />

Both code I add to PDF through mPDF library

Code 128 Error with "+" Symbol

Hello,

I got some errors with my code 128 barcode.
I am using it for openssl strings, and if in this string a "+" Symbol occures it just doesn't occure in the barcode picture.

As far as I know the barcode 128 should allow the + Symbol.
I would need some help. Thank you.

FYI:
I am Using not the class as a class. I am using the httpurl to create the image.

UCC-128 ?

Which of symbols in class is equivalent to UCC-128 ?

Coding Standard

Just wondering what's the intended coding standard (if there is one) just so I can run phpcs and know my pull request(s) matches.
Thanks!
Nick

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.