glabels
glabels copied to clipboard
glabels-3-batch: Add support for stdin/stdout pipelines
This would add a powerful use case where one could feed glabels-3-batch
with CSV data on the input, use a template, and pipe the resulting PDF to lp
for immediate printing.
Currently this is possible with a sleight of hand: the /dev/stdout
file can be set as output file, but the stdout will also be used for writing LABEL FILE = test.glabels
.
Is the LABEL FILE
output useful to anyone?
Todos:
- [ ] support the
glabels-3-batch -o -
shorthand to signify stdout as the output pdf file - [ ] clean up any use of diagnostic writes onto the stdout, and use stderr instead
Thanks for the above I didn't know you could redirect to /dev/stdout
But trying the following the LABEL FILE output corrupts the resulting PDF.
cat merge.csv | glabels-3-batch -o /dev/stdout -i - 100x50sample.glabels | \
sed -n '/%PDF-1.5/,/%%EOF/p' | lpr -PPDF -J jobname
Here is another workaround
./s.perl|glabels-3-batch -C -i - -o /dev/stderr i.glabels 1>/dev/null 2>&1 |lpr
by the way
./s.perl|glabels-3-batch -C -i - -o - i.glabels |sed -n '/%PDF-1.5/,/%%EOF/p'|lpr
also currently works