make the script fit to page images (later i will make it customizable from the web ui)

This commit is contained in:
matu6968 2024-11-01 14:14:42 +01:00
parent 81642f5973
commit 25fefef893

View File

@ -14,20 +14,20 @@ for file in "$1"; do
echo $imagelogmsg echo $imagelogmsg
cp $1 $HOME/imagelog cp $1 $HOME/imagelog
echo "Printing image/document" echo "Printing image/document"
lpr -o portrait -o media=A4 $1 -P $printer # if you are using a different printer that requires different commands to print, change this part of the code. lpr -o portrait -o media=A4 -o fit-to-page $1 -P $printer # if you are using a different printer that requires different commands to print, change this part of the code.
else else
echo "Printing image/document" echo "Printing image/document"
lpr -o portrait -o media=A4 $1 -P $printer # if you are using a different printer that requires different commands to print, change this part of the code. lpr -o portrait -o media=A4 -o fit-to-page $1 -P $printer # if you are using a different printer that requires different commands to print, change this part of the code.
fi fi
elif [[ "$mime_type" == text/* ]]; then elif [[ "$mime_type" == text/* ]]; then
if [[ $2 == log ]]; then if [[ $2 == log ]]; then
echo $imagelogmsg echo $imagelogmsg
cp $1 $HOME/imagelog cp $1 $HOME/imagelog
echo "Printing text" echo "Printing text"
lpr -o portrait -o media=A4 $1 -P $printer # if you are using a different printer that requires different commands to print, change this part of the code. lpr -o portrait -o media=A4 -o fit-to-page $1 -P $printer # if you are using a different printer that requires different commands to print, change this part of the code.
else else
echo "Printing text" echo "Printing text"
lpr -o portrait -o media=A4 $1 -P $printer # if you are using a different printer that requires different commands to print, change this part of the code. lpr -o portrait -o media=A4 -o fit-to-page $1 -P $printer # if you are using a different printer that requires different commands to print, change this part of the code.
fi fi
else else
echo "Error: Invalid file type or, ePrint clone only accepts the following MIME types: text/*, image/*, application/pdf" echo "Error: Invalid file type or, ePrint clone only accepts the following MIME types: text/*, image/*, application/pdf"