in reply to help with Barcode::Code128

I am confused about what you are looking for. You are setting the text to encode three different times, and generating two separate images, although you only save the last one to a file. That last one has a fixed string ("CODE 128") so you should be getting the same .png file each time.

Here's some quick-n-dirty code that produces three barcodes with different integer texts, hope it can help you.

#/usr/bin/perl use strict; use warnings; use diagnostics; use Barcode::Code128; my $times = 3; print "Running Barcode... encoding $times random integers\n"; my $object = Barcode::Code128->new(); $object->code('A'); # Enforce 128A? srand(0); # More interested in repeatability than randomness foreach (1 .. $times) { my $text = ""; # Make up a 10-digit decimal number $text .= "".int(rand(10)) foreach (1 .. 10); my $filename = "code128_".$_.".png"; open(my $png, ">", $filename) || die("Cannnot open $filename: $!") +; binmode($png); print $png $object->png($text); close($png); print "Text \"$text\" encoded in file $filename\n"; }

Replies are listed 'Best First'.
Re^2: help with Barcode::Code128
by Anonymous Monk on Oct 24, 2011 at 08:50 UTC
    I am using code128 for barcode creation through perl and the barcode will print in the pdf. It is working fine for normal characters. But it is not working for the characters إنِ... (Swedish). In pdf the characters are printing in the different charectors. Can any one give me any suggestion to work with swedish characters in barcode? Thanks in advance.

      Code128 says that swedish characters are not supported.

        Is there any other Symbology for supporting Swedish char?