#!/bin/sh
#BK nov 2007
#it seems built-in to gtk and gnomeprint print-dialogs, if choose print-
#preview, tries to run 'evince' -- which is a Gnome document viewer.
#i looked at what gets passed into this 'evince' script when try to print-
#preview from Leafpad:
#--unlink-tempfile --preview --print-settings /tmp/settings5F8P1T.ini /tmp/previewQ2HM1T.pdf
#...interesting, it's a pdf file. so, do this...


ONLYFILENAMES="`echo -n "$*" | tr '\t' ' ' | tr -s ' ' | tr ' ' '\n' | grep -v '^-' | grep 'pdf$' | tr '\n' ' '`"

exec epdfview $ONLYFILENAMES
