Skip navigation
Currently Being Moderated

Need Help Displaying Code128 Bar Code

Jun 11, 2013 12:50 PM

Tags: #code128 #bar_code

I have an ASP classic page were I can render a 3of9 bar code using Javascript where the bar code is rendered as an image.  I need to do the same thing using code128 but can't find a suitable script.  Does anyone have one they are willing to share?  I have Googled this to death!  Thanks in advance for any help!

 
Replies
  • Currently Being Moderated
    Jun 11, 2013 3:41 PM   in reply to bake01

    Apparently it can be done using Perl:
    https://github.com/mstratman/HTML-Barcode-Code128

     

    And CPAN has an HTML Solution:
    http://search.cpan.org/~mstrat/HTML-Barcode-Code128-0.11/lib/HTML/Barc ode/Code128.pm

     

    I don't see that either of those renders as an image though.

     

    Is the image rendering an absolute requirement?

     
    |
    Mark as:
  • Currently Being Moderated
    Jun 12, 2013 11:40 AM   in reply to bake01

    From CPAN FAQs:

    Barcode::Code128 generates bar codes using the CODE 128 symbology. It can generate images in PNG or GIF format using the GD package, or it can generate a text string representing the barcode that you can render using some other technology if desired.

    The intended use of this module is to create a web page with a bar code on it, which can then be printed out and faxed or mailed to someone who will scan the bar code. The application which spurred its creation was an expense report tool, where the employee submitting the report would print out the web page and staple the receipts to it, and the Accounts Payable clerk would scan the bar code to indicate that the receipts were received.

    The default settings for this module produce a large image that can safely be FAXed several times and still scanned easily. If this requirement is not important you can generate smaller image using optional parameters, described below.

    If you wish to generate images with this module you must also have the GD module (written by Lincoln Stein, and available from CPAN) installed. Using the libgd library, GD can generate files in PNG (Portable Network Graphics) or GIF (Graphic Interchange Format) formats.

    Starting with version 1.20, and ending with 2.0.28 (released July 21st, 2004), GD and the underlying libgd library could not generate GIF files due to patent issues, but any modern version of libgd (since 2004) can do GIF as the patent has expired. Most browsers have no trouble with PNG files.

    In order to ensure you have a sufficiently modern installation of the GD module to do both GIF and PNG formats, we require version 2.18 of GD (which in turn requires libgd 2.0.28) or higher.

    If the GD module is not present, you can still use the module, but you will not be able to use its functions for generating images. You can use the barcode() method to get a string of "#" and " " (hash and space) characters, and use your own image-generating routine with that as input.

    To use the the GD module, you will need to install it along with this module. You can obtain it from the CPAN (Comprehensive Perl Archive Network) repository of your choice under the directory authors/id/LDS. Visit http://www.cpan.org/ for more information about CPAN. The GD home page is: http://stein.cshl.org/WWW/software/GD/GD.html

     

    I believe that is EXACTLY what you're looking for.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (1)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points