Although the right parameter of a filtered symbol goes directly from
the input file into the filter with no possibility of variable
substitution first, the filter command itself does go through
Lout variable substitution. So you need to move your filter
input from stdin to a command line option, like this:
def @BarCode
left product_code
right junk
{
def @Filter { "product_code_to_barcode -c \"" product_code "\"" }
}
This way, when you call
17830-363 @BarCode {}
you will be executing your filter as
product_code_to_barcode -c "17830-363"
It will be fed an empty stdin file, or rather a file with just
a newline in it, the result of passing the contents of {}
uninterpreted to the filter. You don't have to read that file.
If I've understood you correctly, the output of your filter is
text of the form
{ ... } @Graphic { ... }
This Lout object will then be the value of 17830-363 @BarCode {}
as desired. It sounds like you have the best (most flexible) plan
for getting the size right, so no need to change anything there.
Jeff