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:
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;
}
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?
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
|
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.
|
|