labels->labelsetup( Avery => $labels->averycode(8160), PaperSize => 'letter', Font => 'Times-Roman', Y_Adjust => 1 / 16, X_Adjust => 1 / 16, ); #Generate image foreach my$row (@$rows) { my $barcode = (GD::Barcode::Code39->new('*'.$row->[1].'*')->plot(NoText=>1, Height=>20)->gif()); my $barcode_64 = encode_base64($barcode); my $barcode_image = $Cgi->img({-src => "data:image/gif;base64,$barcode_64"}); #Array with label data we need push(@data, [$row->[3] . " " . $row->[5] . " " . $row->[6], "CMDM# " . $row->[0] . " ". "Copy# " . $row->[4], $barcode_image, $row->[1],"Property of Me"]); } print $Cgi->header(-type => "application/ps", -attachment => 'test.ps'), $labels->makelabels(\@data);