/usr/bin/gm-print_doc is in gnumed-client 1.4.6+dfsg-1.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 | #!/bin/sh
# ===========================================================
# Print documents via system tools.
#
# The GNUmed client expects to be able to run this command
# in a systemwide way, ie. it needs to be accessible in the
# executable $PATH (such that "which gm-print_doc" gives a
# useful answer). There can be several copies per system in
# which way users can override a system default script with
# their own.
#
# Typical locations for this script would be
#
# /usr/bin/
# /usr/local/bin/
# ~/bin/
#
# See
#
# client/pycommon/gmPrinting.py::known_printjob_types
#
# for a list of print job type tags.
#
# ===========================================================
TYPE="$1" # this is a tag as to what type of print job this is
shift 1
FILES="$@" # this is / those are the file(s) to print
# detect printer manager
CALL_PRINTER_MANAGER=""
# removed by KDE 4 :-(
## kprinter ?
#if [ "${CALL_PRINTER_MANAGER}" = "" ]; then
# A=`which kprinter`
# if [ $? = 0 ]; then
# CALL_PRINTER_MANAGER="kprinter -c ${FILES}"
# fi
#fi
# gtklp ?
if [ "${CALL_PRINTER_MANAGER}" = "" ]; then
A=`which gtklp`
if [ $? = 0 ]; then
CALL_PRINTER_MANAGER="gtklp -i ${FILES}"
fi
fi
# Darwin/MacOSX ?
if [ "${CALL_PRINTER_MANAGER}" = "" ]; then
SYSTEM=`uname -s`
if [ ${SYSTEM} = "Darwin" ]; then
CALL_PRINTER_MANAGER="open -a Preview ${FILES}"
#CALL_PRINTER_MANAGER="open ${FILES}"
fi
fi
# generic badness ?
if [ "${CALL_PRINTER_MANAGER}" = "" ]; then
A=`which acroread`
if [ $? = 0 ]; then
CALL_PRINTER_MANAGER="acroread ${FILES}"
fi
fi
# nothing found ?
if [ "${CALL_PRINTER_MANAGER}" = "" ]; then
echo ""
echo "Cannot find any of kprinter, gtklp, MacOSX/Darwin, or acroread."
echo "Cannot print document(s)."
echo ""
exit 127
fi
# start printing
if [ "${TYPE}" = "generic_document" ]; then
${CALL_PRINTER_MANAGER}
exit $?
fi
if [ "${TYPE}" = "medication_list" ]; then
${CALL_PRINTER_MANAGER}
EXIT_CODE=$?
rm -f ${FILES}
exit ${EXIT_CODE}
fi
echo ""
echo "Unknown print job type <${TYPE}>. Cannot print document(s)."
echo ""
exit 127
# ===========================================================
# http://lists.gnu.org/archive/html/gnumed-devel/2010-01/msg00112.html
#
# MacOSX:
#
# alternate Mac methods to open the PDF in Preview
# (uncomment one of the following)
# open -a Preview <filename> or
# osascript -e 'tell application "Preview" to open ((POSIX file "fullySpecifiedFilenameInQuotes") as text)'
#
# Figured I may as well also capture a link to the following
# method, in case we should in future (on Macs) pass
# parameters into an AppleScript:
#
# http://developer.apple.com/mac/library/qa/qa2001/qa1111.html
#
# http://forums.macosxhints.com/showthread.php?s=&threadid=19736
#
#
# Windows:
#
# - freeware 'PrintFile" (as at 2009) supports batch command piping
# - use "AcroRd32.exe /s /o /h /p $FILES" (requires Acrobat Reader to be installed)
# - refer to http://www.robvanderwoude.com/printfiles.php#PrintPDF
# - http://pages.cs.wisc.edu/~ghost/gsview/gsprint.htm
# - http://stackoverflow.com/questions/4498099/silent-printing-of-a-pdf-in-python
#
# ===========================================================
|