Warning: this is an htmlized version!
The original is here, and
the conversion rules are here.
#######
#
# E-scripts on scanning.
#
# Note 1: use the eev command (defined in eev.el) and the
# ee alias (in my .zshrc) to execute parts of this file.
# Executing this file as a whole makes no sense.
# An introduction to eev can be found here:
#
#   (find-eev-quick-intro)
#   http://angg.twu.net/eev-intros/find-eev-quick-intro.html
#
# Note 2: be VERY careful and make sure you understand what
# you're doing.
#
# Note 3: If you use a shell other than zsh things like |&
# and the for loops may not work.
#
# Note 4: I always run as root.
#
# Note 5: some parts are too old and don't work anymore. Some
# never worked.
#
# Note 6: the definitions for the find-xxxfile commands are on my
# .emacs.
#
# Note 7: if you see a strange command check my .zshrc -- it may
# be defined there as a function or an alias.
#
# Note 8: the sections without dates are always older than the
# sections with dates.
#
# This file is at <http://angg.twu.net/e/scan.e>
#           or at <http://angg.twu.net/e/scan.e.html>.
#        See also <http://angg.twu.net/emacs.html>,
#                 <http://angg.twu.net/.emacs[.html]>,
#                 <http://angg.twu.net/.zshrc[.html]>,
#                 <http://angg.twu.net/escripts.html>,
#             and <http://angg.twu.net/>.
#
#######





# «.djview»			(to "djview")
# «.djview-default-page»	(to "djview-default-page")
# «.djview-page»		(to "djview-page")
# «.bmps-to-djvu»		(to "bmps-to-djvu")
# «.sane»			(to "sane")
# «.hplip»			(to "hplip")
# «.tesseract»			(to "tesseract")
# «.potrace»			(to "potrace")
# «.gocr»			(to "gocr")
# «.gscan2pdf»			(to "gscan2pdf")
# «.ocropus»			(to "ocropus")
# «.ocrfeeder»			(to "ocrfeeder")
# «.xsane-needs-root»		(to "xsane-needs-root")
# «.djvu2pdf»			(to "djvu2pdf")
# «.djvu-split»			(to "djvu-split")
# «.repacking-djvus»		(to "repacking-djvus")
# «.djvu-unpack»		(to "djvu-unpack")
# «.extract-pages»		(to "extract-pages")
# «.scantailor»			(to "scantailor")
# «.xsane-deb-src»		(to "xsane-deb-src")
# «.imgrep»			(to "imgrep")
# «.scanner.el»			(to "scanner.el")
# «.sng»			(to "sng")



# http://www.linux.com/archive/feature/138511
# http://www-sop.inria.fr/marelle/Vladimir.Komendantsky/djvu-HOWTO.html
# http://www.gnurou.org/blog/2007/01/08/how_create_ebooks_linux
# http://www.howtoforge.com/creating_djvu_documents_on_linux

# (find-zsh "dmissing djvm")
# (find-status   "djvulibre-bin")
# (find-vldifile "djvulibre-bin.list")
# (find-udfile   "djvulibre-bin/")
# (find-man "1 djvu")
# (find-man "1 djvu" "djvm(1)")
# (find-man "1 djvu" "cjb2(1)")
# (find-man "1 djvm" "djvm -c[reate] doc.djvu page1.djvu ... pageN.djvu")
# (find-man "1 djvmcvt")
# (find-man "1 cjb2" "  -dpi n")
# (find-man "1 cjb2" "  -lossy")

# (find-man "a djvm")

# (find-man "1 djvu" "ddjvu(1)")
# (find-man "1 ddjvu")

# (find-man "1 djvused")




#####
#
# djview
# 2013apr03
#
#####

# «djview» (to ".djview")
# (find-status   "djview4")
# (find-vldifile "djview4.list")
# (find-udfile   "djview4/")

# (find-man "1 djview4")
# (find-man "1 djview4")
# (find-man "1 djview4" "-page=pagename")
# (find-man "1 djview4" "-pageno=pagenumber")
# (find-man "1 djview4" "key" "SHIFT+F1" "Activate the contextual help")
# (find-man "1 djview4" "W" "Select the \"Fit Width\" zooming mode")
# (find-man "1 djview4" "P" "Select the \"Fit Page\" zooming mode")
# (find-man "1 djview4" "F11")

# «djview-default-page» (to ".djview-default-page")
# (find-fline "~/LUA/djview-hack.lua")
# (find-es "unix" "find")
# (find-sh "find ~ -mmin -20 2> /dev/null")
# (find-fline "~/.config/DjVuLibre/DjView.conf")
# (find-fline "~/.config/DjVuLibre/DjView.conf" "recentFiles=")

# «djview-page» (to ".djview-page")
# 2014mar05: neither "-page" nor "-pageno" work on wheezy

* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
DJVU=$HOME/books/__comp/bentley__programming_pearls.djvu
DJVU=$HOME/books/__logic/copi__introducao_a_logica.djvu
ls -l $DJVU
djview $DJVU
djview -page=2 $DJVU
djview -page=99 $DJVU
djview -pageno=99 $DJVU
djview -pageno=2 $DJVU
djview -verbose -page=2 $DJVU
djview -verbose -page=99 $DJVU
djview -verbose -pageno=99 $DJVU
djview -verbose -pageno=2 $DJVU
djview --help
djview -verbose -help
djview -version
djview4 --help

evince --help
evince --page-index=2 $DJVU
evince -f --page-index=99 $DJVU
evince -s --page-index=99 $DJVU
evince -w --page-index=99 $DJVU

evince -geometry +0+0 -s --page-index=99 $DJVU



#####
#
# Converting a series of PBMs (or BMPs) to a single DJVu file
# 2010feb25
#
#####

# «bmps-to-djvu»  (to ".bmps-to-djvu")
# (find-angg ".zshrc" "BMPtodjvu")

# (find-fline "~/SCANS/")
* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
cd ~/SCANS/
convert lawvere70_001.bmp lawvere70_001.pbm
file *
cjb2 -dpi 600 -lossy lawvere70_001.pbm lawvere70_001.djvu
laf

for i in 001 002 003 004 005 006 007 008 009 010 011 012 013 014; do
  echo convert lawvere70_$i.bmp lawvere70_$i.pbm
       convert lawvere70_$i.bmp lawvere70_$i.pbm
done
for i in 001 002 003 004 005 006 007 008 009 010 011 012 013 014; do
  echo cjb2 -dpi 600 -lossy lawvere70_$i.pbm lawvere70_$i.djvu
       cjb2 -verbose -dpi 600 -lossy lawvere70_$i.pbm lawvere70_$i.djvu
done
djvm -create lawvere70.djvu lawvere70_*.djvu


* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
# (find-fline "~/SCANS/caderno2/")
# (find-man "1 convert")
# (find-man "1 convert" "-despeckle")
# (find-man "1 identify")
# (find-man "1 ImageMagick")
# (find-man "1 djvm")

cd ~/SCANS/caderno2/
for i in *.BMP; do
  j=$(basename $i .BMP).pbm
  k=$(basename $i .BMP).djvu
  echo convert $i $j
       convert $i $j
  echo cjb2 -dpi 600 -lossy $j $k
       cjb2 -dpi 600 -lossy $j $k
done
djvm -create caderno.djvu caderno_*.djvu
# (find-djvupage "~/SCANS/caderno2/caderno.djvu")

cp -v caderno.djvu /tmp/pen/

# (find-sh "identify -list format")
http://www.fileformat.info/format/bmp/egff.htm


* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
# (find-fline "~/SCANS/HU/")
cd ~/SCANS/HU/
for i in hu_*.BMP; do
  j=$(basename $i .BMP).pbm
  k=$(basename $i .BMP).djvu
  echo convert $i $j
       convert $i $j
  echo cjb2 -dpi 600 -lossy $j $k
       cjb2 -dpi 600 -lossy $j $k
done
djvm -create hu.djvu hu_*.djvu

# (find-angg "SCANS/caderno1/Makefile")





#####
#
# sane
# 2010mar14
#
#####

# «sane»  (to ".sane")
# (find-zsh "availabledebs | sort | grep sane")
# (find-status   "sane")
# (find-vldifile "sane.list")
# (find-udfile   "sane/")
# (find-status   "sane-utils")
# (find-vldifile "sane-utils.list")
# (find-udfile   "sane-utils/")
# (find-status   "libsane")
# (find-vldifile "libsane.list")
# (find-vldifile "libsane.list" "/usr/share/man/man5/")
# (find-udfile   "libsane/")
# (find-status   "libsane-extras")
# (find-vldifile "libsane-extras.list")
# (find-udfile   "libsane-extras/")

# (find-man "7 sane")
# (find-man "8 saned")
# (find-man "1 sane-find-scanner")
# (find-man "1 scanimage")
# (find-man "1 gamma4scanimage")
# (find-man "5 sane-net")
# (find-man "5 sane-hp")
# (find-man "5 sane-hp4200")

# http://www.xsane.org/xsane-introduction.html
# http://hplipopensource.com/hplip-web/index.html

# (find-man "1 xscanimage")
# (find-fline "~/.sane/xsane/")

* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
sane-find-scanner -v
# (find-sh "sane-find-scanner -v")
# (find-man "scanimage")
scanimage -L
# (find-fline "/etc/sane.d/")

hplip




#####
#
# hplip
# 2010nov20
#
#####

# «hplip»  (to ".hplip")
# (find-sh "grep-aptavail -P hplip")

# (find-status   "hplip")
# (find-vldifile "hplip.list")
# (find-udfile   "hplip/")
# (find-status   "hplip-cups")
# (find-vldifile "hplip-cups.list")
# (find-udfile   "hplip-cups/")
# (find-status   "hplip-data")
# (find-vldifile "hplip-data.list")
# (find-udfile   "hplip-data/")
# (find-status   "hplip-dbg")
# (find-vldifile "hplip-dbg.list")
# (find-udfile   "hplip-dbg/")
# (find-status   "hplip-doc")
# (find-vldifile "hplip-doc.list")
# (find-udfile   "hplip-doc/")
# (find-status   "hplip-gui")
# (find-vldifile "hplip-gui.list")
# (find-udfile   "hplip-gui/")

# (find-fline "/usr/share/ppd/hplip/HP/")
# (find-fline "/usr/share/doc/hplip-doc/HTML/")
# file:///usr/share/doc/hplip-doc/HTML/index.html
# file:///usr/share/doc/hplip-doc/HTML/hpscan.html
# file:///usr/share/doc/hplip-doc/HTML/scanning.html

apti hplip hplip-cups hplip-data hplip-dbg hplip-doc hplip-gui





#####
#
# Tesseract
# 2010sep29
#
#####

# «tesseract»  (to ".tesseract")
# https://en.wikipedia.org/wiki/Tesseract_(software)
# http://code.google.com/p/tesseract-ocr/
http://code.google.com/p/tesseract-ocr/wiki/ReadMe
http://code.google.com/p/tesseract-ocr/downloads/list

apti tesseract-ocr tesseract-ocr-eng tesseract-ocr-por

# (find-status   "tesseract-ocr")
# (find-vldifile "tesseract-ocr.list")
# (find-udfile   "tesseract-ocr/")
# (find-status   "tesseract-ocr-eng")
# (find-vldifile "tesseract-ocr-eng.list")
# (find-udfile   "tesseract-ocr-eng/")
# (find-status   "tesseract-ocr-por")
# (find-vldifile "tesseract-ocr-por.list")
# (find-udfile   "tesseract-ocr-por/")

# (find-man "1 tesseract")
# (find-man "1 wordlist2dawg")
# (find-man "1 mftraining")
# (find-man "1 unicharset_extractor")
# (find-man "1 cntraining")

* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
cd /tmp/scans/
laf
convert p049.jpg p049.tif
laf
tesseract p049.tif p049.txt -l por

* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
cd /tmp/scans/
laf
convert p049.jpg -resize 25% p049_4.jpg
convert p049.jpg -resize 50% p049_2.jpg
convert p049_4.jpg p049_4.tif
convert p049_4.jpg p049_2.tif
laf p049*.jpg
laf p049*.tif
tesseract p049_4.tif p049_4 -l por
tesseract p049_2.tif p049_2 -l por
xzgv &



-x -f 50 -t 0.02. 


#####
#
# Thresholding images for tesseract
# 2010oct23
#
#####

# Two quotes from
#   <http://www.mscs.dal.ca/~selinger/ocr-test/>:
# From each original color image, I also produced two thresholded
# bitonal images. The first bitonal image was obtained by naively
# thresholding the color image at a grey level of 0.5. The second
# bitonal image was obtained by a custom method which first applied a
# highpass filter with a radius of 50 pixels, and then thresholded at
# a grey value of 0.02. The custom filtering and thresholding was done
# using the mkbitmap program, using the parameters -x -f 50 -t 0.02.
# The intention of the custom thresholding method was to produce a
# lighter image, thereby increasing separation between individual
# letters.

# In terms of accuracy, Tesseract vastly outperforms both Ocrad and
# GOCR on bitonal images. But strangely, Tesseract is completely
# useless on input that is not bitonal, so one should always threshold
# the input first. The actual thresholding method used seems almost
# irrelevant, which makes me wonder why Tesseract doesn't simply
# threshold its non-bitonal input internally.

# http://www.mscs.dal.ca/~selinger/ocr-test/
# http://www.mscs.dal.ca/~selinger/potrace/mkbitmap.html
# http://www.mscs.dal.ca/~selinger/potrace/
# http://www.mscs.dal.ca/~selinger/potrace/potrace.pdf
# (find-status   "potrace")
# (find-vldifile "potrace.list")
# (find-udfile   "potrace/")
# (find-man "1 mkbitmap")
# (find-man "5 pnm")
# (find-man "5 pgm")

# http://www.mscs.dal.ca/~selinger/software.html
# http://www.mscs.dal.ca/~selinger/ocr-test/
# http://potrace.sourceforge.net/
# http://potrace.sourceforge.net/potrace.pdf

* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
cd /tmp/scans/
convert p049_2.jpg p049_2.pgm
laf p049*
mkbitmap -x -f 50 -t 0.02  -o p049_2.pbm  p049_2.pgm
mkbitmap -x -f 50 -t 0.1   -o p049_2.pbm  p049_2.pgm
mkbitmap -x -f 50 -t 0.2   -o p049_2.pbm  p049_2.pgm
mkbitmap -x -f 50 -t 0.3   -o p049_2.pbm  p049_2.pgm
mkbitmap -x -f 50 -t 0.4   -o p049_2.pbm  p049_2.pgm
xzgv p049_2.pbm &
xzgv &


convert p049.jpg -resize 25% p049_4.jpg

for ORIGSTEM in p050 p051; do
  STEM=${ORIGSTEM}_4
  echo $ORIGSTEM
  echo $STEM
  echo convert $ORIGSTEM.jpg -resize 25% $STEM.jpg
       convert $ORIGSTEM.jpg -resize 25% $STEM.jpg
  echo convert $STEM.jpg $STEM.pgm
       convert $STEM.jpg $STEM.pgm
  echo mkbitmap -x -f 50 -t 0.4 $STEM.pgm -o $STEM.pbm
       mkbitmap -x -f 50 -t 0.4 $STEM.pgm -o $STEM.pbm
  # xzgv    $STEM.pbm &
  echo convert $STEM.pbm $STEM.tif
       convert $STEM.pbm $STEM.tif
  echo tesseract         $STEM.tif $STEM -l por
       tesseract         $STEM.tif $STEM -l por
done

# (find-fline "/tmp/scans/" "p049.txt")
# (find-fline "/tmp/scans/" "p049_4.txt")
# (find-angg "SCANS/Makefile")


* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
cd ~/SCANS/serfelizhoje/
laf
make -f ../Makefile p049.4por
make -f ../Makefile p049_4.jpg
make -f ../Makefile p049_4.por.txt
make -f ../Makefile p0{49,50,51,52,53,54,55,56,57,58,59}.4por

for i in p0{49,50,51,52,53,54,55,56,57,58,59}; do
  make -f ../Makefile ${i}_4.jpg ${i}_4.por.txt
done

cd ~/SCANS/serfelizhoje/
for i in p0{49,50,51,52,53,54,55,56,57,58,59}; do
  make -f ../Makefile ${i}_4_400.djvu
done
laf

cd ~/SCANS/serfelizhoje/
rm -v all.djvu all.pdf
make -f ../Makefile all.djvu all.pdf

djvm -create p.djvu p???_4_400.djvu
# (find-fline    "~/SCANS/serfelizhoje/")
# (find-djvupage "~/SCANS/serfelizhoje/all.djvu")
# (find-pdf-page "~/SCANS/serfelizhoje/all.pdf")

# How do I add the OCRed text to the dvju and to the pdf?

# (find-angg "SCANS/")
# (find-angg "SCANS/Makefile")
# (find-angg "SCANS/serfelizhoje/")
# (find-efunction 'find-eeshell)
# (find-eeshell "cp -v /tmp/scans/p050.jpg .\nlaf\nmake p050.4por\nlaf")



convert p049_2.pbm p049_2.tif
tesseract p049_2.tif p049_2 -l por




convert p049.jpg  -scale 0.25 p049_4.jpg
file *

# (find-man "ImageMagick")
# (find-man "convert")



       tesseract imagename outputbase [configfile] [-l <langid>]






# (find-fline "/usr/bin/ocroscript")
# (find-man "1 ocroscript")

http://ftp.de.debian.org/debian/pool/main/t/tesseract-eng/tesseract-eng_2.00-1.dsc




#####
#
# potrace
# 2020feb14
#
#####

# «potrace» (to ".potrace")
# http://potrace.sourceforge.net/potrace.pdf
# (code-pdf-page "potrace" "$S/http/potrace.sourceforge.net/potrace.pdf")
# (code-pdf-text "potrace" "$S/http/potrace.sourceforge.net/potrace.pdf")
# (find-potracepage)
# (find-potracetext)
# (find-man "1 potrace")

# (find-sh "potrace --help")

http://potrace.sourceforge.net/potracelib.pdf
http://potrace.sourceforge.net/
https://cscott.net/Projects/Mallard/ stained glass
https://esslab.jp/~ess/en/research/sketch/








#####
#
# GOCR
# 2010sep29
#
#####

# «gocr»  (to ".gocr")
# (find-status   "gocr")
# (find-vldifile "gocr.list")
# (find-udfile   "gocr/")



#####
#
# gscan2pdf
# 2010oct22
#
#####

# «gscan2pdf»  (to ".gscan2pdf")
# http://gscan2pdf.sourceforge.net/
# (find-status   "gscan2pdf")
# (find-vldifile "gscan2pdf.list")
# (find-udfile   "gscan2pdf/")
# (find-man "1p gscan2pdf")
# (find-man "1p scanimage-perl")
# (find-man "1p scanadf-perl")




#####
#
# ocropus
# 2010oct22
#
#####

# «ocropus»  (to ".ocropus")
# http://code.google.com/p/ocropus/
# http://groups.google.com/group/ocropus
# http://groups.google.com/group/ocropus/web
# http://code.google.com/p/ocropus/wiki/ReleaseNotes
# (find-status   "ocropus")
# (find-vldifile "ocropus.list")
# (find-udfile   "ocropus/")

# (find-THLsh "grep -i ocr $(find * | grep Makefile)")
# (find-THLsh "grep -i ocr $(find * -type f)")
# (find-THLsh "grep -i tesseract $(find * -type f)")
# (to "tesseract")





#####
#
# ocrfeeder
# 2016may23
#
#####

# «ocrfeeder» (to ".ocrfeeder")
# (find-status   "ocrfeeder")
# (find-vldifile "ocrfeeder.list")
# (find-udfile   "ocrfeeder/")






#####
#
# XSane can only use the scanner as root
# 2010oct22
#
#####

# «xsane-needs-root»  (to ".xsane-needs-root")
# (find-angg ".emacs" "scan")
# https://bugs.launchpad.net/ubuntu/+source/system-config-printer/+bug/545737
# http://ubuntuforums.org/showthread.php?t=1337039
# http://www.yolinux.com/TUTORIALS/LinuxTutorialScanners.html
scanimage -L
# (find-man "lsusb")
# (find-man "xsane")

http://ubuntuforums.org/showthread.php?t=507621

* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
lsusb
ls -l /dev/bus/usb/*/*
lpstat -v
lpinfo -v
sane-find-scanner
scanimage -L
hp-check -r
hp-info -i

# http://hplip.sourceforge.net/install/index.html

su -c "apt-get install --force-yes -y python-qt4-dbus"
su -c "apt-get install --force-yes -y python-reportlab"

apti python-qt4-dbus
apti python-reportlab

# (find-man "groups")
# (find-man "5 group")
# (find-node "(coreutils)groups invocation")
# http://en.wikipedia.org/wiki/Group_identifier_%28Unix%29
# (find-fline "/etc/group")

# (find-man "adduser" "Add an existing user to an existing group")

* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
sudo adduser edrx lp
groups
# (find-sh "sort < /etc/group")
# (find-sh "sort < /etc/group | grep lp")
# (find-sh "sort < /etc/group | grep edrx")



* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
system-config-printer

 	  #8

I was able to detect my HP Photosmart C4700 using the command '
hp-probe -bnet
hp-probe

# (find-man "1 hp-probe")




#####
#
# djvu2pdf
# 2010apr10
#
#####

# «djvu2pdf»  (to ".djvu2pdf")
# http://0x2a.at/static/site/projects/djvu2pdf/djvu2pdf_0.9.1_all.deb
# http://0x2a.at/static/site/projects/djvu2pdf/djvu2pdf-0.9.1.tar.gz
# https://0x2a.at/site/projects/djvu2pdf/djvu2pdf_0.9.2-1_all.deb
# http://www.0x2a.at/s/projects/djvu2pdf

* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
# sudo dpkg -i $S/http/0x2a.at/static/site/projects/djvu2pdf/djvu2pdf_0.9.1_all.deb
sudo   dpkg -i $S/https/0x2a.at/site/projects/djvu2pdf/djvu2pdf_0.9.2-1_all.deb

# (find-status   "djvu2pdf")
# (find-vldifile "djvu2pdf.list")
# (find-udfile   "djvu2pdf/")
# (find-udfile   "djvu2pdf/copyright")
# (find-fline "/usr/bin/djvu2pdf")
# (find-man "1 djvu2pdf")
# (find-man "1 ddjvu")
# (find-man "1 djvudump")

# (find-angg ".emacs" "caderno")
# (find-caderno2page 22 "C2" "Exercícios de Integral de Riemann")

* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
mkdir /tmp/cad/
cd    /tmp/cad/
cp -v ~/SCANS/caderno2/caderno.djvu .
# (find-man "1 djvm")
# (find-man "1 ddjvu")
ddjvu -format=pdf -page=22 caderno.djvu 2009nov16-int-riemann.pdf
# (find-pdf-page "/tmp/cad/2009nov16-int-riemann.pdf")
# (find-fline "/tmp/cad/")
# http://angg.twu.net/2010.1/2009nov16-int-riemann.pdf

# (find-man "1 djvuextract")
# (find-man "1 ddjvu")



# (find-angg ".zshrc" "BMPtodjvu")
# (find-fline "~/SCANS/caderno3/")

* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
cd ~/SCANS/caderno3/
laf *.BMP
BMPtodjvu caderno3_*.BMP
djvm -create caderno3.djvu caderno3_*.djvu
ddjvu -format=pdf -page=1,2 caderno3.djvu C2_exercicios_2010aug25.pdf
# (find-fline    "~/SCANS/caderno3/")
# (find-djvupage "~/SCANS/caderno3/caderno3.djvu")
# (find-pdf-page "~/SCANS/caderno3/C2_exercicios_2010aug25.pdf")

* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
cd ~/SCANS/caderno3/
laf *.BMP
BMPtodjvu caderno3_0{08,09,10}.BMP
djvm -create      C2_exercicios_2010sep05.djvu caderno3_0{08,09}.djvu
ddjvu -format=pdf C2_exercicios_2010sep05.djvu C2_exercicios_2010sep05.pdf

djvm -create      MD_props_e_lemas_2010sep08.djvu caderno3_010.djvu
ddjvu -format=pdf MD_props_e_lemas_2010sep08.djvu MD_props_e_lemas_2010sep08.pdf

* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
# (find-fline "~/SCANS/2010sep15/")
cd ~/SCANS/2010sep15/
file *
convert   C2_exercicios_2010sep15.png C2_exercicios_2010sep15.BMP
BMPtodjvu C2_exercicios_2010sep15.BMP
laf
ddjvu -format=pdf C2_exercicios_2010sep15.djvu C2_exercicios_2010sep15.pdf
laf

set | grep -ai angg
# (find-man "1 grep" "-a, --text")
# (find-angg ".emacs" "tramp-twu")
# (code-c-d "tmp" "/tmp/")
# (find-code-c-d "tmp" "/tmp/")

# (find-node "(eshell)Command arguments")
# (find-node "(eshell)Invocation")
# (find-node "(eshell)Built-ins")

* (eepitch-eshell)
* (eepitch-kill)
* (eepitch-eshell)
cd ~/SCANS/2010sep15/
cp -v C2_exercicios_2010sep15.djvu (ee-tmpfile "")
cp -v C2_exercicios_2010sep15.djvu /tmp/pen/
cd /tmp/pen/
ddjvu -format=pdf C2_exercicios_2010sep15.djvu C2_exercicios_2010sep15.pdf
cp -v /tmp/pen/C2_exercicios_2010sep15.djvu (ee-twusfile "C2/")
cp -v /tmp/pen/C2_exercicios_2010sep15.pdf  (ee-twusfile "C2/")

* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
cd ~/SCANS/caderno3/
laf
BMPstopdf C2_exercicios_2010sep15 foo_00{1,2}.BMP
BMPstopdf C2_P1_2010sep22 foo_00{3,4}.BMP
# (find-fline "~/SCANS/caderno3/")

* (eepitch-eshell)
* (eepitch-kill)
* (eepitch-eshell)
# (find-fline "~/SCANS/caderno3/")
# (find-twusfile "C2/")
cd ~/SCANS/caderno3/
cp -v C2_exercicios_2010sep15.djvu (ee-twusfile "C2/")
cp -v C2_exercicios_2010sep15.pdf  (ee-twusfile "C2/")
cp -v C2_P1_2010sep22.djvu (ee-twusfile "C2/")
cp -v C2_P1_2010sep22.pdf  (ee-twusfile "C2/")

* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
cd ~/SCANS/univ_form_cid/
laf
BMPstopdf hch_e_rinesi hch*.BMP rinesi*.BMP

BMPstopdf C2_P1_2010sep22 foo_00{3,4}.BMP
# (find-fline "~/SCANS/caderno3/")
# (find-fline "~/SCANS/univ_form_cid/")


* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
cd ~/SCANS/caderno3/
BMPstopdf caderno3_012to015_tmp caderno3_0{12,13,14,15}*.BMP




#####
#
# pdf2djvu
# 2013may04
#
#####

# «pdf2djvu» (to ".pdf2djvu")
# (find-status   "pdf2djvu")
# (find-vldifile "pdf2djvu.list")
# (find-udfile   "pdf2djvu/")
# (find-man "1 pdf2djvu")
# (find-man "1 pdf2djvu" "--lossy")
# (find-man "1 pdf2djvu" "--loss-level=n")
# (find-man "1 cjb2" "-losslevel x")

cd /tmp/books/
nice pdf2djvu -v --lossy \
    -o thucydides_hobbes_grene__the_peloponnesian_war.djvu \
       thucydides_hobbes_grene__the_peloponnesian_war.pdf \

cd /tmp/books/
nice pdf2djvu -v --loss-level=150 \
    -o thucydides_hobbes_grene__the_peloponnesian_war_150.djvu \
       thucydides_hobbes_grene__the_peloponnesian_war.pdf \

cd /tmp/books/
nice pdf2djvu -v --loss-level=190 \
    -o thucydides_hobbes_grene__the_peloponnesian_war_190.djvu \
       thucydides_hobbes_grene__the_peloponnesian_war.pdf \

# (find-fline "/tmp/books/")




#####
#
# split djvu into pages
# 2015dec09
#
######

# «djvu-split» (to ".djvu-split")
# http://unix.stackexchange.com/questions/20592/extract-several-pages-from-a-djvu-file
# (find-man "1 djvused")

# Extract and save each page in its own file
pages=$(djvused -e 'n' "$if")
for ((i=1; i<=$pages; i++)) ;do
    of="${if%.*}.$(printf "%03d" $i).djvu"
    djvused -e "select $i; save-page-with \"$of\"" "$if"
done





#####
#
# Repacking djvus (several into one)
# 2011mar03
#
#####

# «repacking-djvus»  (to ".repacking-djvus")
# «djvu-unpack»  (to ".djvu-unpack")
# (find-es "scan" "djvu2pdf")
# (find-zsh "dmissing djvu | grep pdf")
# (find-man "1 pdf2djvu")
# (find-fline "$S/http/angg.twu.net/MD/")
# (find-fline "/tmp/djvus-md1/")
# (find-sh "djvused")
# (find-sh "djvused" "select <id>")

# (find-fline "/tmp/")
* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
cd /tmp/
pdf2djvu -o MD_exercicios_2010mar29.djvu MD_exercicios_2010mar29.pdf

* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
cd $S/http/angg.twu.net/MD/
A=(
MD_exercicios_2010mar29.djvu
MD_exercicios_2010mar29_gabarito.djvu
MD_props_e_lemas_2010sep08.djvu
MD_sists_dedutivos_2010nov17.djvu
MD_sists_dedutivos_2010nov21.djvu
MD_P1_2010oct06.djvu
MD_P2_2010nov29.djvu
MD_P3_2010dec06.djvu
MD_VR_2010dec10.djvu
MD_VS_2010dec13.djvu
)
rm -Rv /tmp/djvus-md0/
mkdir  /tmp/djvus-md0/
cp -v $A /tmp/djvus-md0/
cd   /tmp/djvus-md0/
for i in $A; do echo "$i:"; djvused -e 'ls' $i; done
for i in $A; do echo "$i:"; djvused -e 'n' $i; done

rm -Rv /tmp/djvus-md1/
mkdir  /tmp/djvus-md1/
cd     /tmp/djvus-md1/
npage=0
for fname_djvu in $A; do
  dir_fname_djvu=/tmp/djvus-md0/$fname_djvu
  npages=$(djvused -e 'n' $dir_fname_djvu)
  echo "$dir_fname_djvu: $npages"
  for i in $(seq 1 $npages); do
    npage=$[$npage+1]
    npage_djvu=$(printf "p%03d.djvu" $npage)
    # djvused -e "select $i; save-page $npage_djvu" $dir_fname_djvu
    djvused -e "select $i; save-page-with $npage_djvu" $dir_fname_djvu
  done
done
# make -f ~/SCANS/Makefile all.djvu
djvm -create all.djvu p*.djvu

* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
cd $S/http/angg.twu.net/MD/
A=(
MD_exercicios_2010mar29.djvu
MD_exercicios_2010mar29_gabarito.djvu
MD_props_e_lemas_2010sep08.djvu
MD_P1_2010oct06.djvu
MD_sists_dedutivos_2010nov17.djvu
MD_sists_dedutivos_2010nov21.djvu
MD_P2_2010nov29.djvu
MD_P3_2010dec06.djvu
MD_VR_2010dec10.djvu
MD_VS_2010dec13.djvu
)
rm -Rv /tmp/djvu-u/
mkdir  /tmp/djvu-u/
cd     /tmp/djvu-u/
for i in $A; do cp -v $S/http/angg.twu.net/MD/$i /tmp/djvu-u/; done
cd     /tmp/djvu-u/
djvu-unpack $A
djvu-repack /tmp/foo.djvu

# (find-djvupage "/tmp/foo.djvu")
Falta a prova para monitor.

echo "$i:"; djvused -e 'ls' $i; done




#####
#
# Extracting a few pages from a djvu
# 2012mar20
#
#####

# «extract-pages»  (to ".extract-pages")
# (find-angg "SCANS/Makefile" "extract-page")
# (find-angg ".zshrc" "djvu-unpack")
# (find-angg     "genericfigures/README")
# (find-twusfile "genericfigures/")

* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
cp -v ~/SCANS/caderno2/caderno.djvu /tmp/
cd /tmp/
djvused -e "select 51; save-page-with eduardo_ochs_RRZ_notes_2009.djvu" caderno.djvu
make -f ~/SCANS/Makefile eduardo_ochs_RRZ_notes_2009.pdf





#####
#
# Scantailor
# 2012sep21
#
#####

# «scantailor»  (to ".scantailor")
# http://sourceforge.net/apps/mediawiki/scantailor/index.php?title=Building_from_source_code_on_Linux_and_Mac_OS_X
# http://scantailor.sourceforge.net/
# (find-fline "~/tmp/scantailor-0.9.11.1.tar.gz")
#*
rm -Rv ~/usrc/scantailor-0.9.11.1/
tar -C ~/usrc/ -xvzf \
  ~/tmp/scantailor-0.9.11.1.tar.gz
cd     ~/usrc/scantailor-0.9.11.1/

#*
# (code-c-d "scantailor" "~/usrc/scantailor-0.9.11.1/")
# (find-scantailorfile "")





#####
#
# xsane (from the debian sources)
# 2013may23
#
#####

# «xsane-deb-src» (to ".xsane-deb-src")
# (find-es "gimp" "scanning")
# http://ftp.de.debian.org/debian/pool/main/x/xsane/
# http://ftp.de.debian.org/debian/pool/main/x/xsane/xsane_0.998-4.dsc
# http://ftp.de.debian.org/debian/pool/main/x/xsane/xsane_0.998-4.debian.tar.gz
# http://ftp.de.debian.org/debian/pool/main/x/xsane/xsane_0.998.orig.tar.gz
#*
rm -Rv ~/usrc/xsane/
mkdir  ~/usrc/xsane/
cd $S/http/ftp.de.debian.org/debian/pool/main/x/xsane/
cp -v xsane_0.998* ~/usrc/xsane/
cd     ~/usrc/xsane/
dpkg-source -sn -x xsane_0.998-4.dsc
cd     ~/usrc/xsane/xsane-0.998/
dpkg-buildpackage -us -uc -b -rfakeroot     |& tee odb

#*
# (find-fline "~/usrc/xsane/")
* (eepitch-shell)
cd ~/usrc/xsane/
sudo dpkg -i *.deb

#*
# (code-c-d "xsane" "~/usrc/xsane/xsane-0.998/")
# (find-xsanefile "")




#####
#
# imgrep - a grep for images
# 2020jan16
#
#####

# «imgrep» (to ".imgrep")
# https://github.com/keeferrourke/imgrep




#####
#
# scanner.el
# 2020dec14
#
#####

# «scanner.el»  (to ".scanner.el")



#####
#
# sng -- a compiler for an editable PNG representation
# 2021jun21
#
#####

# «sng»  (to ".sng")
# (find-status   "sng")
# (find-vldifile "sng.list")
# (find-udfile   "sng/")
# https://github.com/axot/SNG




# http://angg.twu.net/GA/GA_teste1_2011apr07.djvu
# http://angg.twu.net/GA/GA_P1_2011may19.djvu
# http://angg.twu.net/GA/GA_P1_2011jun01.djvu
# http://angg.twu.net/GA/GA_lista_2011jun09.djvu
# http://angg.twu.net/GA/GA_exercicios_2011jun16.djvu
# http://angg.twu.net/GA/GA_miniteste_2011jul06.djvu
# http://angg.twu.net/GA/GA_P2_2011jul07.djvu
# http://angg.twu.net/GA/GA_VS_2011jul14.djvu




http://www.diybookscanner.org/

http://stevelosh.com/blog/2011/05/paper-free/
http://ryanwaggoner.com/2010/11/how-i-filled-two-dumpsters-and-went-paperless-with-the-fujitsu-scansnap-s1500/
http://www.jboecker.de/2010/04/14/general-reference-filing-with-org-mode.html#sec-5

https://news.ycombinator.com/item?id=30760850 Vuescan – Software support for 6500 abandoned scanners (hamrick.com)
https://news.ycombinator.com/item?id=32539455 LibGen's Bloat Problem (liberalgeneral.neocities.org)





#  Local Variables:
#  coding:               utf-8-unix
#  End: