summaryrefslogtreecommitdiff
path: root/Scripts/Scanner.py
diff options
context:
space:
mode:
authorjbjjbjjbj <julianteule@gmail.com>2017-01-13 20:02:01 +0100
committerjbjjbjjbj <julianteule@gmail.com>2017-01-13 20:02:01 +0100
commit70b65b88ac2119600b68e1a75e3053459d171764 (patch)
treec013223d81f30bdcdebe44ffe05bba30eb5cfb58 /Scripts/Scanner.py
parent9394dfc3c3e6cf07e6bdf08aaa663bc1063265e6 (diff)
Added new scripts
Diffstat (limited to 'Scripts/Scanner.py')
-rwxr-xr-xScripts/Scanner.py31
1 files changed, 31 insertions, 0 deletions
diff --git a/Scripts/Scanner.py b/Scripts/Scanner.py
new file mode 100755
index 0000000..04538c4
--- /dev/null
+++ b/Scripts/Scanner.py
@@ -0,0 +1,31 @@
+#!/usr/bin/env python
+
+import getch
+import os
+
+page = 0
+
+name = input("Enter name of pdf: ")
+
+while(1):
+ print("Press q for exit, Space for scanning, and d for done")
+ x = getch.getch()
+ if(x == 'q'):
+ exit()
+ elif(x == ' '):
+ print("Starting scan of page " + str(page+1))
+ os.system("scanimage --device genesys:libusb:001:004 --format=tiff > scan" + str(page) + ".tiff")
+ page += 1
+ print("Scan done")
+ elif(x == 'd'):
+ print("Collecting tiff pages")
+ os.system("tiffcp scan*.tiff magazine.tiff");
+ print("Making pdf file")
+ os.system("convert magazine.tiff '" + name + ".pdf'")
+ print("Removing tiffs")
+ os.system("rm *.tiff")
+ print("Done resetting vars")
+ page = 0
+ name = input("Enter name of pdf: ")
+
+