Code Monkey home page Code Monkey logo

barcode's Introduction

Hey there ๐Ÿ‘‹

Somethings about me ๐Ÿ˜„

  • Developer and software engineer since 2005 - Freelance since 2020
  • A Fullstack Dev who loves working in TypesScript Ecosystem!
  • I love working with React / Node / Typescript (currently ๐Ÿ˜‰)
  • Loves everything about retro-gaming - I collect old video game consoles - I like to fix them ๐ŸŽฎ

Currently Learning ๐Ÿ“–

  • Electronic
  • Golang

You can reach out to me at

barcode's People

Contributors

adrienv1520 avatar alphaone89 avatar andygock avatar b0rek avatar jagandecapri avatar jbdemonte avatar jsdelivrbot avatar kakisoft avatar nerrad avatar raldochea avatar robbie-coder 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar

barcode's Issues

BMP datamatrix jQuery barcode has incorrect size in header

When I create a datamatrix barcode using the jQuery library with version 2.2.0 the bmp image looks correctly on screen but the image size in the bitmap header is incorrect. This causes image parsing libraries like in Java to throw exceptions when parsing the image.

jQuery example to generate the barcode:
var settings = { output: 'bmp', moduleSize: 1, showHRI: false }; $('#barcode').barcode('000100011100000100000000ZV2OKP2L3T21F,375886182,305.81', 'datamatrix', settings);

When I try to parse it with Java I get this error:
javax.imageio.IIOException: Invalid width/height for BI_RGB image data. at java.desktop/com.sun.imageio.plugins.bmp.BMPImageReader.readHeader(BMPImageReader.java:600) at java.desktop/com.sun.imageio.plugins.bmp.BMPImageReader.getWidth(BMPImageReader.java:206)

The Java code recently includes a security fix that checks the bitmap size in the header if it is correct see: openjdk/jdk@c70f7ca Although the error messages talks about width and height the real error is the image data size check in that bit of the Java code.

That check fails because the size in the bitmap header is way too small only 782 (hex bytes 0E 03 00 00) while it should be 2134 (hex bytes 56 08 00 00). If I open the bitmap that the barcode library created in Paint and do a save as (still as bitmap) I can see that the size in the header is now correct and now Java doesn't throw the exception.

See the attached bmp barcodes.zip where one is created from the library and the other is a save as from paint.

barcode in pdf (How to determine page is filled)

Hello,
I am trying to output barcode in pdf using fpdf. I went through your sample-fpdf.php. In my case user will enter number of barcode to be generated. Based on the number same barcode will be generated x no. of time. I tried to modify the code by adding these two line multiple time with value of $y different
$data = Barcode::fpdf($pdf, $black, $x, $y, $angle, $type, array('code'=>$code), $width, $height);
$pdf->TextWithRotation($x + $xt, $y + $yt, $data['hri'], $angle);
My question is how will i determine that page is filled and i have to add new page and continue with barcode printing

Problem with checksum for UPC barcode

Hi! In my app i need to draw UPC barcode, and the problem is, that it computes checksum even if it's already appended to the end.
For example, this is a correct barcode 210000001147 and when i'm passing it to drawing function, i'm getting this 100000011162. Seems like it is removing first digit and calculating checksum again.
Any help will be really appreciated.

Problem with SVG in chrome since version 72

There's a parser error when generating a valid code in chrome's latest version:

This page contains the following errors:
error on line 1 at column 129: AttValue: ' expected
Below is a rendering of the page up to the first error.

Probably there are characters that have to be escaped or replaced.

Doesn't works with FPDF 1.81

The library doesn't work because the FPDF author made private some variables and functions.

The private items accessed by barcode library are :

line 205 : $pdf->h;
line 206 : $pdf->k;
line 212 : $pdf->_out();

Rectangular Extension of Data Matrix

In the transition from 98 to 99 errors occur. There is no indication where is that you may only use 98 characters.

Test setup:

    $IMAGE_RESOURCE = imagecreatetruecolor( 600, 600 );
    $black  = imagecolorallocate( $IMAGE_RESOURCE, 0x00, 0x00, 0x00 );
    $white  = imagecolorallocate( $IMAGE_RESOURCE, 0xff, 0xff, 0xff );
    imagefilledrectangle( $IMAGE_RESOURCE, 0, 0, 600, 600, $white );
    $x = 300;
    $y = 300;
    $angle = 0;
    $property_array = array( 'code' => str_repeat( '1', 99 ), 'rect' => true );
    $width = null;
    $height = null;
    $data = Barcode::gd( $IMAGE_RESOURCE, $black, $x, $y, $angle, 'datamatrix', $property_array, $width, $height );

Notice: Undefined offset: -1 in /Applications/XAMPP/xamppfiles/htdocs/php-barcode-2.0.5/php-barcode.php on line 2275
Notice: Undefined offset: -1 in /Applications/XAMPP/xamppfiles/htdocs/php-barcode-2.0.5/php-barcode.php on line 2281
Notice: Undefined offset: -1 in /Applications/XAMPP/xamppfiles/htdocs/php-barcode-2.0.5/php-barcode.php on line 2293
Notice: Undefined offset: -1 in /Applications/XAMPP/xamppfiles/htdocs/php-barcode-2.0.5/php-barcode.php on line 2295
Notice: Undefined offset: -1 in /Applications/XAMPP/xamppfiles/htdocs/php-barcode-2.0.5/php-barcode.php on line 2301
Notice: Undefined offset: -1 in /Applications/XAMPP/xamppfiles/htdocs/php-barcode-2.0.5/php-barcode.php on line 2303
Notice: Undefined offset: -1 in /Applications/XAMPP/xamppfiles/htdocs/php-barcode-2.0.5/php-barcode.php on line 2305
Notice: Undefined offset: -1 in /Applications/XAMPP/xamppfiles/htdocs/php-barcode-2.0.5/php-barcode.php on line 2307
Notice: Undefined offset: -1 in /Applications/XAMPP/xamppfiles/htdocs/php-barcode-2.0.5/php-barcode.php on line 2321
Warning: Division by zero in /Applications/XAMPP/xamppfiles/htdocs/php-barcode-2.0.5/php-barcode.php on line 2323
Warning: array_fill() expects parameter 2 to be integer, float given in /Applications/XAMPP/xamppfiles/htdocs/php-barcode-2.0.5/php-barcode.php on line 1844
Warning: Division by zero in /Applications/XAMPP/xamppfiles/htdocs/php-barcode-2.0.5/php-barcode.php on line 1870

October 23, 2015 DIN will publish the new standard DIN 16587 Rectangular Extension of Data Matrix.
http://www.eurodatacouncil.org/en/news/46-extended-rectangular-data-matrix.html

PHP 5.3

It should be noted that the php class seems to need PHP 5.3 (because of the "use" keyword).

Maybe the readme could be updated.

Found incorrect function call in getDigit function for "msi" barcode type (jQuery barcode plugin 2.0.3)

Hi,

I am using the following version:
BarCode Coder Library (BCC Library)
Porting : jQuery barcode plugin
Version : 2.0.3
Date : 2013-01-06

Found incorrect function call in getDigit function for "msi" barcode type,
getDigit: function(code, crc){
var table = "0123456789";
var index = 0;
var result = "";

    //code = this.compute(code, false);  // old code
    code = this.compute(code, crc);    // suggest the fix
    ...

},

Best Regards,
Joseph Ou

barcode/php/sample php/sample-fpdf-code128.php

Notice: iconv(): Wrong charset, conversion from CP852 to CP1250 is not allowed in /Applications/XAMPP/xamppfiles/htdocs/php-barcode-2.0.5/sample-fpdf-code128.php on line 79

FPDF error: Some data has already been output, can't send PDF file

syntax error, unexpected T_FUNCTION in php-barcode.php

Hello,

Function works until i refresh a website, then I get this error:

Parse error: syntax error, unexpected T_FUNCTION in /my/ftp_address/www/barcode/php-barcode.php on line 166

The "php-barcode.php" didn't touched. Can you help?

EAN 13 change the number

I generate bar code from ID of a items, the items have max lenght of 4 chars, but I fill the other spaces using 0 but when the bar code is generate show another number diferent to the ID. I try in the generator online and the issue is the same. Try using 0000000001998 in the online generator and show 0000000001991.
PD. My english skills are too bad.
issue

Fix for tiny sizes

Hi!
Sry for my bad english.
I HAD an issue with tiny size bar (used PHP liblary):
Barcode::gd($image, $black, $col+150, $p*$k+120, 0, "code128", $bankAccount, 1.5, 10)

bars for width between 1 and 3 was a problem.

How do I fix that?

    // GD barcode renderer
    private static function digitToGDRenderer($gd, $color, $xi, $yi, $angle, $mw, $mh, $digit){
        $fn = function($points) use ($gd, $color) {
            $points[2]--; //////////////////////////////////////////// Added that (second X)
            $points[4]--; //////////////////////////////////////////// Added that (third X)
            //print_r($points);
            //exit();
            imagefilledpolygon($gd, $points, 4, $color);
        };
        return self::digitToRenderer($fn, $xi, $yi, $angle, $mw, $mh, $digit);
    }

After that its fine!
Tested with: Honeywell Voyager 1250g

Datamatrix creation generate Notice: Undefined offset: [n_row]

Hi,
during the generation of datamatrix code in FPDF istance the execution trig an notice error of undefined offset.
The datamatrix generated seems doesn't have any problem under read with an 2Dbarcode scanner.
I attach the code above

require_once('fpdf17/efpdf.php'); //FPDF with TextWithRotation method
require_once('php-barcode.php'); // The class :-)

$type = 'datamatrix';
$black = '000000';
$height = null;
$width = 0.7;
$angle = 0;

$pdf = new eFPDF();
$pdf->AddPage();

$x_barcode = 123;
$y_barcode = 49;

$barcode_string = "LYDAGAAVVISLTP0141002000158";

$codice = array('code'=>$barcode_string,'rect' => true);

$datamatrix = Barcode::fpdf($pdf, $black, $x_barcode , $y_barcode, $angle, $type, $codice , $width, $height);

$pdf->SetFont('Arial','',3);
$pdf->TextWithRotation($datamatrix['p4']['x'] + 1, $datamatrix['p4']['y'] + 2, $datamatrix['hri'], 0,0);

$pdf->Output("test.pdf");

Thanks for your attention

Gabri

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.