Results 1 to 4 of 4

Thread: drawing barcode with GNU Barcode

  1. #1
    Join Date
    Dec 2010
    Posts
    3
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default drawing barcode with GNU Barcode

    Hi. I'm developing a report design application. I want the user to be able to add some types of barcode like EAN-13, CODE-39, CODE-128 etc. I use GNU Barcode library to create the barcodes. The library generates a PostScript file and I read the x, y, width and height values from the PostScript file and I save the each bar as a QRectF object.
    I draw the bars with QPainter::drawRect() function. If any two bars are very close to each other(like 0,15), the space between them disappears and they seem as a wider single bar so the barcode reader cannot read the barcode that I printed to a page. Maybe the float values in the QRectF object are casted to integer inside the QPainter class. I would appreciate any suggestions to draw this barcode in another way please.

  2. #2
    Join Date
    Aug 2009
    Location
    Belgium
    Posts
    310
    Thanks
    10
    Thanked 31 Times in 25 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: drawing barcode with GNU Barcode

    You could try this : EAN-13_Barcode_class

    Regards,
    Marc

  3. #3
    Join Date
    Feb 2010
    Posts
    52
    Thanks
    6
    Thanked 2 Times in 2 Posts

    Default Re: drawing barcode with GNU Barcode

    Are you sure that your pen width isnt causing your bars to run into one another ? Try using a thinner pen.

  4. #4
    Join Date
    Dec 2010
    Posts
    3
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: drawing barcode with GNU Barcode

    I set the pen to Qt::NoPen already. I also tried to draw the bars thinner but it couldn't be read by the barcode reader.

Similar Threads

  1. Code128 barcode
    By wirasto in forum Qt-based Software
    Replies: 3
    Last Post: 8th August 2015, 03:12
  2. Barcode library
    By NoRulez in forum Qt Programming
    Replies: 6
    Last Post: 20th December 2013, 04:14
  3. WIN32 + Barcode
    By aekilic in forum Qt Programming
    Replies: 12
    Last Post: 14th May 2009, 21:12
  4. how make barcode in Qt 4 Win 32 ?
    By agoestafin in forum Qt Programming
    Replies: 2
    Last Post: 30th January 2009, 07:32
  5. Qt + Barcode Reader
    By sunil.thaha in forum General Discussion
    Replies: 12
    Last Post: 13th November 2007, 12:13

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.