glabels icon indicating copy to clipboard operation
glabels copied to clipboard

glabels-3-batch: Add support for stdin/stdout pipelines

Open pushytoxin opened this issue 5 years ago • 2 comments

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

pushytoxin avatar Mar 07 '19 11:03 pushytoxin

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

toggenation avatar Jan 27 '20 10:01 toggenation

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

hildred avatar Apr 30 '20 21:04 hildred