madizen has asked for the wisdom of the Perl Monks concerning the following question:
I have some legacy code for a public library app to generate codabar barcodes to PDF for on-demand inventory labels. The old code made a call to $pdf->barcode() but that method is deprecated.
Old code in question:
Codabar functionality in PDF::API2 has moved to PDF::API2::Resource::XObject::Form::BarCode::codabar but I can't figure out how to give it these same args (input string, all those zoning params, etc. Admittedly this is probably due to a density issue in my own gray matter. I tried PDF::Report->drawBarcode which takes similar args, but that module's use of PDF::API2 also seems to be obsolete. Can someone please offer a translation for the new PDF::API2?sub makebarcode { # given a string, return encoded codabar as image my $code = shift(@_); my $img = $pdf->barcode( -type => $type, -font => $pdffont, -code => $code, -quzn => $quzn, -umzn => $umzn, -lmzn => $lmzn, # fontsize at bottom -zone => $zone, -ofwt => $owft, -text => $label, -fnsz => $fnsz, -spcr => $spcr, ); return $img; }
Back to
Seekers of Perl Wisdom