= Printing to screen = This is how to setup a __'''HACK'''__ that re-directs printouts to a screen. == Limitations: == * Only works on Linux * Can only send output to a pre-defined DISPLAY == Background work: == * Become the {{{ root }}} user {{{ su - }}} * Ensure SELinux is disabled or a SELinux rule is set to allow cups to run scripts from {{{ /etc/cups/interfaces/ }}} * Install mpage and ggv {{{ yum install mpage ggv }}} * Go to the {{{ lp }}} user's home directory {{{ cd ~lp }}} * Create the files required by {{{ ggv }}} for the {{{ lp }}} user {{{ touch .recently-used mkdir .gnome .gnome2 .gnome2_private chown lp:lp .recently-used .gnome .gnome2 .gnome2_private}}} == Reports == * Create a CUPS printer: * Device = file:/dev/null * Type = Raw Print Queue * Go to the {{{ /etc/cups/interfaces/ }}} directory * Create a file of the same name as the newly created CUPS printer {{{ #!/bin/sh export DISPLAY= TEMPFILE=/tmp/`basename $0`.$$ cat $6 > $TEMPFILE.1 cat $TEMPFILE.1 | mpage -1 -o -ba4 > $TEMPFILE.2 cat $TEMPFILE.2 | gs -q -sDEVICE=pswrite -sPAPERSIZE=a4 -dNOPAUSE -dBATCH -sOutputFile=$TEMPFILE.3 - /usr/bin/ggv --display=$DISPLAY $TEMPFILE.3}}} * Create a Control printer * Text Printer = Y * Type = Form Printer * Set the required terminal record to use the new "printer" {{{ teaad}}} == Dockets == * Create a CUPS printer: * Device = file:/dev/null * Type = Raw Print Queue * Go to the {{{ /etc/cups/interfaces/ }}} directory * * Create a file with the same name as the newly created CUPS printer {{{ export DISPLAY=<_Required_X11_Display_> TEMPFILE=/tmp/`basename $0`.$$ LOGO=/etc/cups/interfaces/<_Docket_Logo_>.epsi cat $6 > $TEMPFILE.1 cat $TEMPFILE.1 | mpage -1 -o -ba4 > $TEMPFILE.2 /usr/bin/pstops 0\(0cm,-3cm\) $TEMPFILE.2 $TEMPFILE.3 cat $TEMPFILE.3 | cat $LOGO - >$TEMPFILE.4 cat $TEMPFILE.4 | gs -q -sDEVICE=pswrite -dNOPAUSE -dBATCH -dDEVICEXRESOLUTION=90 -dDEVICEYRESOLUTION=90 -sOutputFile=$TEMPFILE.5 - /usr/bin/ggv --display=$DISPLAY $TEMPFILE.5 }}} * * Create a Control printer * Text Printer = Y * Type = Form Printer * Set the required terminal record to use the new "printer" {{{ teaad}}} == Overlays == * Create a CUPS printer: * Device = file:/dev/null * Type = Raw Print Queue * Go to the {{{ /etc/cups/interfaces/ }}} directory * Create a copy of the overlay script. * Add the following lines: {{{ export DISPLAY=<_Required_X11_Display_> ... <_Body_of_Overlay_Script_> ... gs -sDEVICE=pswrite -sPAPERSIZE=a4 -dNOPAUSE -dBATCH -sOutputFile=$TEMPFILE.final $TEMPFILE.*.ps /usr/bin/ggv --display=$DISPLAY $TEMPFILE.final #cat $TEMPFILE.final}}} * Create a Control printer * Text Printer = Y * Type = Form Printer * Set the required terminal record to use the new "printer" {{{ teaad}}} ---- . CategoryPrinter