Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
2 tasks
pushytoxin opened this issue Mar 7, 2019 · 2 comments · May be fixed by #65
Open
2 tasks

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

pushytoxin opened this issue Mar 7, 2019 · 2 comments · May be fixed by #65

Comments

@pushytoxin
Copy link

pushytoxin commented Mar 7, 2019

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
@toggenation
Copy link

toggenation commented Jan 27, 2020

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

@hildred
Copy link

hildred commented Apr 30, 2020

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 hildred linked a pull request Apr 30, 2020 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants