in reply to Re: translation request PDF::API old barcode call to new PDF::API
in thread translation request PDF::API old barcode call to new PDF::API

Documentation? er... what's that? ;) The -type arg is obviously not needed anymore and I think I can add back the -text label (it is important) just by sending that to the pdf document separately from the barcode, as I have working examples of sending text to the document. However... while pdf->xo_codabar() now returns something, I need to place it on the page at a specific location. This used to be like this:
# encode string $code as codabar image $bar my $bar = makebarcode ($code); # Working! Thank you! # Place it at x,y page coordinates with scale and frame options. # Doesn't work. $gfx->barcode($bar, $x, $y, $scale, $frame); # Don't work neither. $gfx->xo_codabar($bar, $x, $y, $scale, $frame)
Now I get: Can't locate object method "what_I_tried" via package "PDF::API2::Content" Well, that's progress anyway. Just acquiring the barcode image was 80% of my battle. I will mull the meditations offered, but if you or anyone can just throw me the required "output $bar at coordinates" incantation, I have the rest of my legacy issues already wrapped. I found and tried:
$gfx->image($bar, $x, $y, $scale);
But $bar is not an image? (Anyway I get a blank document, which is better than an error message). Found it!
# Works! $gfx->formimage($bar, $x, $y, $scale);

Replies are listed 'Best First'.
Re^3: translation request PDF::API old barcode call to new PDF::API
by djlerman (Beadle) on Oct 12, 2010 at 21:53 UTC
    Hey there.. Do you have a full example of this code? I am trying to do almost the exact same thing. What I need to do is create and print individual barcodes that will print onto Avery labels. Thanks, ~Donavon