summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorJohannes Ranke <jranke@uni-bremen.de>2016-10-26 12:58:45 +0200
committerJohannes Ranke <jranke@uni-bremen.de>2016-10-26 15:05:52 +0200
commitde43eb36413ac4f2d4705e619c829c0f117adce7 (patch)
tree7447904c130ab53c3785bb7862292d5f5dae5241 /bin
Initial commit
Diffstat (limited to 'bin')
-rwxr-xr-xbin/a4copy26
-rwxr-xr-xbin/pdfscan33
2 files changed, 59 insertions, 0 deletions
diff --git a/bin/a4copy b/bin/a4copy
new file mode 100755
index 0000000..de45664
--- /dev/null
+++ b/bin/a4copy
@@ -0,0 +1,26 @@
+#!/bin/sh
+
+usage()
+{
+echo "Usage: a4copy [Lineart|Gray|Color]"
+}
+
+#test to see if the mode and a filename have been entered
+if [ $# -lt 1 ] ; then usage ; exit 1 ; fi
+mode=$1
+
+echo Now scanning your A4 document to pdf
+
+#scan the A4 binary(b&w) file uncompressed at 300dpi to temporary file
+scanimage \
+ --mode $mode \
+ -x 210 -y 296 \
+ --resolution 300 \
+ --format=tiff > temp-copy.tif
+
+#convert to pdf with G4 compression
+tiff2pdf temp-copy.tif -p A4 -q G4 -o temp-copy.pdf
+rm temp-copy.tif
+
+#print pdf
+lpr temp-copy.pdf
diff --git a/bin/pdfscan b/bin/pdfscan
new file mode 100755
index 0000000..5b71b30
--- /dev/null
+++ b/bin/pdfscan
@@ -0,0 +1,33 @@
+#!/bin/sh
+
+usage()
+{
+echo "Usage: pdfscan [Lineart|Gray|Color] [resolution] <nameofimage>"
+}
+
+#test to see if the mode and a filename have been entered
+if [ $# -lt 3 ] ; then usage ; exit 1 ; fi
+mode=$1
+resolution=$2
+name=$3
+
+#read output of help command to get scanner device name
+#scanner=`scanimage --help | tail --lines=1 `
+
+echo Now scanning your A4 document to pdf
+#echo Now scanning your A4 document on $scanner
+
+#scan the A4 binary(b&w) file uncompressed at 300dpi to temporary file
+#scanimage -d $scanner \
+scanimage \
+ --mode $mode \
+ -x 210 -y 296 \
+ --resolution $resolution \
+ --format=tiff > temp-$name.tif
+
+#convert to pdf with G4 compression
+tiff2pdf temp-$name.tif -p A4 -q G4 -o $name.pdf
+rm temp-$name.tif
+
+#display pdf
+okular $name.pdf

Contact - Imprint