add bscan.py
- bscan.py: scan from flatbed to multipage pdf
This commit is contained in:
parent
74a97b7c49
commit
40db455bf6
|
@ -0,0 +1,28 @@
|
||||||
|
#! /usr/bin/python3
|
||||||
|
|
||||||
|
"""Multipage scan script"""
|
||||||
|
|
||||||
|
import subprocess as sp
|
||||||
|
import datetime as dt
|
||||||
|
import os
|
||||||
|
|
||||||
|
pages = int(input("No of pages: "))
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
dn = dt.datetime.now()
|
||||||
|
fp = f"{dn.strftime('%Y%m%d_%H%M')}"
|
||||||
|
for i in range(1, pages+1):
|
||||||
|
print(f"{i} / {pages}")
|
||||||
|
file = f"{fp}_{i:04d}.png"
|
||||||
|
sp.call([
|
||||||
|
'scanimage',
|
||||||
|
'-d', "hpaio:/net/deskjet_3070_b611_series?ip=192.168.178.150&queue=false",
|
||||||
|
'--format=png',
|
||||||
|
'--resolution=200',
|
||||||
|
'--mode=Gray',
|
||||||
|
'--output-file', file
|
||||||
|
])
|
||||||
|
sp.call([
|
||||||
|
'convert', "`ls -d ./{fp}_*`", fp + ".pdf"
|
||||||
|
])
|
||||||
|
print("created multipage PDF {file}.pdf")
|
Loading…
Reference in New Issue