A GUI to produce PDFs or DjVus from scanned documents.
Screenshot: Main page v3.0.0
python3 scantpaper/app.py.
Add --debug|info|warn|error|fatal to enable logging at the
required level.scantpaper supports the following options:
--device=<device>
Specifies the device to use, instead of getting the list from the SANE
API. Useful for remote scanners.
--help
Displays help and exits.
--log=<log-file>
Specifies a file to store logging messages.
--debug, --info, --warn,
--error, --fatal
Defines the log level. Defaults to --debug if a log file is
specified, otherwise --error.
--import=<PDF|DjVu|images>
Imports the specified file(s). For multi-page documents, a window is
displayed to select required pages.
--import-all=<PDF|DjVu|images>
Imports all pages of the specified file(s).
--version
Displays the program version and exits.
Scanning is handled with SANE. PDF conversion uses
img2pdf and ocrmypdf. TIFF export uses
libtiff.
To diagnose errors, start scantpaper from the command line with logging enabled:
python3 scantpaper/app.py --debugscantpaper creates a config file at
~/.config/scantpaperrc. The directory can be changed by
setting $XDG_CONFIG_HOME. Preferences are usually set via
Edit → Preferences.
Debian sid should automatically have the latest
version.
sudo apt update
sudo apt install scantpaperUbuntu users can use the PPA:
sudo apt-add-repository ppa:jeffreyratcliffe/ppa
sudo apt update
sudo apt install scantpaperIn either case to remove scantpaper afterwards:
sudo apt remove scantpaperDownload .whl from Github.
# Install the C-libraries that pip cannot handle:
# For Debian/Ubuntu
sudo apt update
sudo apt install libgirepository-2.0-dev libcairo2-dev pkg-config python3-dev gir1.2-glib-2.0
# For Fedora
sudo dnf install gobject-introspection-devel cairo-devel pkgconf-pkg-config python3-devel
# For Arch
sudo pacman -S gobject-introspection cairo pkgconf python
# For Homebrew
brew install pygobject3 gobject-introspection cairo pkg-config
# Possibly upgrade pip
python3 -m pip install --upgrade pip
# Install from the wheel file, automatically including python dependencies
pip install scantpaper-x.x.x-py3-none-any.whlIf you haven’t already, you will then probably have to add
~/.local/bin to your path in order to find the new
executable, after which you can start it with:
scantpaperTo then remove it:
pip uninstall scantpaperDownload .tar.gz from Github.
tar xvfz scantpaper-x.x.x.tar.gz
cd scantpaper-x.x.x
python3 scantpaper/app.pyBrowse the code at Github:
git clone https://github.com/carygravel/scantpaper.git
cd scantpaper
python3 scantpaper/app.pyIn either of the above two cases, just delete the source directory to remove it.
scantpaper --log=log
with your report.gscan2pdf is partly translated into several languages. Contribute via Launchpad Rosetta.
To test updated .po files:
perl Makefile.PL LOCALEDIR=./locale
perl -I lib bin/gscan2pdf --log=log --locale=localeSet locale variables as needed (e.g., for Russian):
LC_ALL=ru_RU.utf8 LC_MESSAGES=ru_RU.utf8 LC_CTYPE=ru_RU.utf8 LANG=ru_RU.utf8 LANGUAGE=ru_RU.utf8 python3 scantpaper/app.py --log=log --locale=localescantpaper provides a GUI for scanning, editing, and saving documents as PDF, DjVu, TIFF, PNG, JPEG, PNM, or GIF. It supports batch scanning, metadata, OCR, and various editing tools.
%i - input filename%o - output filename%r - resolutionIt may not be supported by SANE or your scanner. If you see it in
scanimage --help but not in scantpaper, send the output to
the maintainer.
Enable “Allow batch scanning from flatbed” in Preferences. Some scanners require additional settings.
The required package may not be installed (e.g., xdg-email, unpaper, imagemagick).
Set “# Pages” to “1” and “Batch scan” to “No”.
Only changelogs from official Ubuntu builds are shown.
If the scanner is remote and not found automatically, specify the device:
scantpaper --device <device>Use pdftotext or djvutxt to extract text.
Many viewers support searching the embedded text layer.
Create or edit ~/.config/gtk-3.0/gtk.css:
.rubberband,
rubberband,
flowbox rubberband,
treeview.view rubberband,
.content-view rubberband,
.content-view .rubberband {
border: 1px solid #2a76c6;
background-color: rgba(42, 118, 198, 0.2);
}
#scantpaper-ocr-output {
color: black;
}“scant” (https://en.wiktionary.org/wiki/scant) in this sense means “short (of)”, as I am trying to digitalise my paperwork, and I liked the play on “scan”.
I started writing gscan2pdf as a Perl & Gtk2 project
in 2006. Version 2 switched to Gtk3, but kept the basic software
architecture. This stored the pages as temporary files with hashed
names, which had a couple of major disadvantages:
Therefore I decided in 2022 to completely rewrite
gscan2pdf in Python and renamed it for v3
scantpaper. The rewrite:
ocrmypdf to write PDFsJeffrey Ratcliffe (jffry at posteo dot net)
img2pdf and ocrmypdf,
without which this would have been much harder.Contributions are welcome. Please submit pull requests, ensuring that
all the tests pass, that new code is covered by new tests, and that the
pylint does not drop.
To run all the tests, just run pytest. To run all the
tests in a particular file,
pytest scantpaper/tests/test_app.py. To run just one test
in a file
pytest scantpaper/tests/test_app.py::test_application_init.
Note that the test suite also tests that the code is formatted with
black. To fix the formatting
black scantpaper.
Similarly to check the linting for one or more files
pylint scantpaper/app.py scantpaper/text_layer_control.py
Copyright © 2006–2026 Jeffrey Ratcliffe jffry@posteo.net
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License v3 as published by the Free Software Foundation.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
On some READMEs, you may see small images that convey metadata, such as whether or not all the tests are passing for the project. You can use Shields to add some to your README. Many services also have instructions for adding a badge.