Site Map - skip to main content - dyslexic font - mobile - text - print

Hacker Public Radio

Your ideas, projects, opinions - podcasted.

New episodes Monday through Friday.


hpr1543 :: What's in my bag

The contents of Ken's bag as he prepares for OHM 2013

<< First, < Previous, Latest >>

Host Image
Hosted by Ken Fallon on 2014-07-02 is flagged as Explicit and is released under a CC-BY-SA license.
Listen in ogg, spx, or mp3 format. | Comments (0)

Part of the series: What's in My Toolkit

This is an open series where Hacker Public Radio Listeners can share with the community the items that they can't live without, what they find useful in day to day life.

Items

$ cat pringbooklet
#!/bin/bash

#HTML Input --> HTML 2 PS --> PS 2 PDF --> PDF Output
#lpstat -p |awk '{print $2}'

if [ $# -lt 2 ]
then
  echo ""
  echo "Usage: `basename $0` {pdf file} {printer name}"
  echo ""
  echo "Available printers: \"$(echo $(lpstat -p |awk '{print $2}' ) )\""
  echo ""
  exit
fi

FILE=$1
PRINTER=$2


if [ $# -eq 3 ]
then
  COPIES="$3"
else
  COPIES="1"
fi

if [ ! -e $FILE ];
then
  echo "Can't find the PDF file $1"
  exit
fi

pdftops -level3 $FILE - | ps2ps - - | psbook | psnup -2 -Pa4 | ps2pdf - |\
    lp -d $PRINTER -o media=a4 -o sides=two-sided-short-edge -n $COPIES -

Comments

Subscribe to the comments RSS feed.

Leave Comment

Powered by Comment Script