kreativekorp / barcode Goto Github PK
View Code? Open in Web Editor NEWbarcode.php - Generate barcodes from a single PHP file. MIT license.
License: MIT License
barcode.php - Generate barcodes from a single PHP file. MIT license.
License: MIT License
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
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
characters such as # + are not passed through/generated on code128, qr, datamatrix ...etc.... is this by design?
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);
`
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
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)
I want to hide barcode text in bottom. Only barcode should display....how to do that?
Hi, I cannot be able to pass url with & in barcode dmtx or qr.
If I use %26 (& in urlencode), barcode seams do not draw correcly.
I need to pass a url like "https://www.domain.ext/wp-admin/post.php?action=edit&post=123"
Any idea?
Thank you, Luca
Can't able to scan EAN8 Type bar code
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.
Hello, how can I save generated barcode as image into file? Is this possible? Or Can I use generated barcode with dompdf? Thank you.
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 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.
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"');
Hi there,
Is it possible to reduce bar width without reducing the whole barcode's width?
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
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.
Which of symbols in class is equivalent to UCC-128 ?
Can we add text above the barcode and just opposite to it
Hello!
This library is great! Quick question though: when using symbology ean128, how can I pass an FNC1 character into the data?
Thank you very much!
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
Hi,
https://i.ibb.co/nPGqTYs/Ekran-Resmi-2019-10-15-17-07-43.png
See the image above. There are margins. How can I remove them?
margin:0
padding:0
thanks
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.