HEX
Server: Apache/2.4.41 (Ubuntu)
System: Linux ip-172-31-42-149 5.15.0-1084-aws #91~20.04.1-Ubuntu SMP Fri May 2 07:00:04 UTC 2025 aarch64
User: ubuntu (1000)
PHP: 7.4.33
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: //usr/share/doc/libsane-common/examples/xerox
#!/bin/sh
#
# This is a xerox script for Laserjet Printer.
# To get use of Postscript change the Printercommand and enable the
# command at the end of this File.
#
DEV=mustek:/dev/scanner
RES=300
PAPERTYPE=letter
#PAPERTYPE=a4
PRINTERTYPE=ps
#PRINTERTYPE=lj
#
# Non-printable area (left, right, top, and bottom margins):
#
LMARGIN=0.0
RMARGIN=0.0
TMARGIN=0.25
BMARGIN=0.0
#
# Scanner-specific options:
#
DEVOPTS="--mode Gray"
#DEVOPTS="$DEVOPTS --custom-gamma=yes --gamma-table [0]0-[64]128-[255]255"
#DEVOPTS="$DEVOPTS --backtrack=yes"	 # needed for Mustek 12000SP
#
# Printer Command/Resolution
PRES=$RES # change this if other Res. is desired
#
# Papersize in inch
if [ "$PAPERTYPE" = "letter" ]; then
  WIDTH=8; HEIGHT=10
else
  # assume a4 paper
  WIDTH=8.27; HEIGHT=11.69
fi

SCANWIDTH=`bc <<_EOF_
scale=3
$WIDTH-$LMARGIN-$RMARGIN
_EOF_`
SCANHEIGHT=`bc <<_EOF_
scale=3
$HEIGHT-$TMARGIN-$BMARGIN
_EOF_`
#
SCALE=`bc << _EOF_
scale=3
75/$RES
_EOF_`

if [ "$PRINTERTYPE" = "ps" ]; then
  POST="pnmtops -rle -scale $SCALE -dpi $PRES | lpr"
else
  POST="pgmtopbm | pbmtolj -resolution $PRES | lpr -Praw"
fi

scanimage -d $DEV \
	-x $SCANWIDTH\" -y $SCANHEIGHT\" -l $LMARGIN\" -t $TMARGIN\" \
        --resolution $RES $DEVOPTS | eval $POST