To say that the documentation on this package is terrible would falsely imply that it existed at all ... A meditation or two have tried to gather some info on this package, but neither is this deep in the PDF::API2 tree.
That said, I'll dig in a little. The pod contains a promising function, and diving into the guts
shows that it will take all of your options except -type and -text. I don't know if you will need them to get the output you are looking for. Maybe the following will help:
use PDF::API2;
my $pdf = PDF::API2->new(-file => 'barcode.pdf');
my $bc = $pdf->xo_codabar(
-font => $pdffont,
-code => $code,
-quzn => $quzn,
-umzn => $umzn,
-lmzn => $lmzn, # fontsize at bottom
-zone => $zone,
-ofwt => $owft,
-fnsz => $fnsz,
-spcr => $spcr,
);
$pdf->save();
Updated: So naturally, another example appears the next day. Doesn't directly help with this problem, but I'm adding the link here just to keep track of it.
The intelligent reader will judge for himself. Without examining the facts fully and fairly, there is no way of knowing whether vox populi is really vox dei, or merely vox asinorum. — Cyrus H. Gordon