padawan_linuxero has asked for the wisdom of the Perl Monks concerning the following question:

Dear monks
I have a question to ask you, is out there a perl module or something to generate a 2D barcode in PDF417?, because right now i need to create one in perl. Is something out there?
Thanks

Replies are listed 'Best First'.
Re: how to create a barcode PDF417
by moklevat (Priest) on Feb 19, 2008 at 04:10 UTC
    There are GD modules on CPAN to create barcodes, but I did not see one specifically for PDF417. You might want to take a look at pdf417_encode instead to see if that might meet your needs.
Re: how to create a barcode PDF417
by andreas1234567 (Vicar) on Feb 19, 2008 at 10:59 UTC
    Apparently pdf417lib comes in 3 flavors: C, C# and Java. You should technically be able to interface the former from Perl. The ReadMe.txt says:
    The example is provided for Windows and was compiled using Visual C++ 6.0. The code can, however, be used with any ANSI C compiler. The only assumption is that an int is at least 32 bit long.
    Compile (on Win32) with gcc (mingw):
    C:\download\pdf417lib\pdf417lib-c-0.91>gcc --version gcc (GCC) 3.4.5 (mingw special) C:\download\pdf417lib\pdf417lib-c-0.91>gcc -o pdf417 pdf417.c pdf417li +b.c C:\download\pdf417lib\pdf417lib-c-0.91>pdf417 hello.ps "hello world" Thello world
    The generated "hello.ps" postscript file:
    /Times findfont 12 scalefont setfont 100 80 moveto (A PDF417 example.)show stroke 100 100 translate 43 22.5 scale 86 15 1 [86 0 0 -15 0 15]{< 00AB8561C571E2A3F0175B 00AB857BCD1BE05630175B 00AB9507C6A06AF0F0175B 00AB82815BE4E50830175B 00AB947DC3EB628E70175B 00AB828F5DF4214130175B 00AB9630C6FA2B11F0175B 00AB8168D82C6A0630175B 00ABAC83D82320B170175B 00ABAE23CA106B9CF0175B 00AB963DD828E2C670175B 00AB9760D9CC205CD0175B 00ABAFAFC31D2BCF30175B 00AB85DEC29E6176F0175B 00AB85E14F852BF610175B >}image showpage
    A simple makefile:
    $ cat makefile CC = gcc -O pdf417 : pdf417.c pdf417lib.c pdf417lib.h $(CC) -o pdf417 pdf417.c pdf417lib.c pdf417lib.h -lm
    Compile and run on Linux i386 (gcc version 3.4.6):
    $ make gcc -O -o pdf417 pdf417.c pdf417lib.c pdf417lib.h -lm Compile on Linux i386: $ ./pdf417 hello.ps "hello world" Thello world
    Converted with ps2pdf is shows the barcode in the lower left corner.

    Update Tue Feb 19 12:26:16 CET 2008: Added sample code.
    Update Wed Feb 20 08:22:01 CET 2008: Added Linux makefile.

    --
    Andreas
      Hi

      Thanks but the developement is in Windows, can this program be use in windows?

        Thanks