Skip to content

Commit d9a6cfb

Browse files
author
Fonic
committed
Release scan2pdf-v2.5
Changes: - Added option '-u/--manual-duplex' to facilitate scanning double-sided documents with devices that lack hardware support for duplex scanning - Added Service Menu for KDE file managers Konqueror and Dolphin for convenient one-click scanning to PDF file via context menu entries - Reduced 'printx()' functions to one-liners, output warnings and errors to stderr
1 parent d66e5f9 commit d9a6cfb

6 files changed

Lines changed: 234 additions & 63 deletions

File tree

CHANGELOG.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
## Changelog for release v2.5
2+
3+
**Changes:**
4+
- Added option `-u/--manual-duplex` to facilitate scanning double-sided
5+
documents with devices that lack hardware support for duplex scanning
6+
- Added _Service Menu_ for KDE file managers _Konqueror_ and _Dolphin_
7+
for convenient one-click scanning to PDF file via context menu entries
8+
19
## Changelog for release v2.4
210

311
**Changes:**
@@ -67,4 +75,4 @@ Initial release (versions prior to v2.1 have not been published).
6775

6876
##
6977

70-
_Last updated: 01/15/24_
78+
_Last updated: 01/23/24_

README.md

Lines changed: 43 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
Scan documents directly to PDF files from the command line. Especially useful
33
to batch-scan large volumes of documents.
44

5+
56
## Donations
67
I'm striving to become a full-time developer of [Free and open-source software
78
(FOSS)](https://en.wikipedia.org/wiki/Free_and_open-source_software). Donations
@@ -11,6 +12,7 @@ help me achieve that goal and are highly appreciated.
1112
<a href="https://paypal.me/fonicmaxxim"><img src="https://raw.githubusercontent.com/fonic/donate-buttons/main/paypal-button.png" alt="Donate via PayPal" height="35"></a>&nbsp;&nbsp;
1213
<a href="https://ko-fi.com/fonic"><img src="https://raw.githubusercontent.com/fonic/donate-buttons/main/kofi-button.png" alt="Donate via Ko-fi" height="35"></a>
1314

15+
1416
## Requirements
1517
**Dependencies:**<br/>
1618
_Bash_ (&ge;v4.0),
@@ -30,12 +32,20 @@ Refer to the [releases](https://github.com/fonic/scan2pdf/releases) section
3032
for downloads links. There is no actual installation required. Simply extract
3133
the downloaded archive to a folder of your choice.
3234

35+
For [KDE](https://kde.org/) file managers
36+
[Konqueror](https://apps.kde.org/konqueror/) and
37+
[Dolphin](https://apps.kde.org/dolphin/), a
38+
[Service Menu](#service-menu) is included that allows for convenient one-click
39+
scanning to PDF file from within the context menu.
40+
41+
3342
## Configuration
3443
Open `scan2pdf.conf` in your favorite text editor and adjust the settings
3544
to your liking. Refer to embedded comments for details. Refer to
3645
[this section](#configuration-options) for a listing of configuration options
3746
and current defaults.
3847

48+
3949
## Quick Start
4050
To scan a single document to PDF file, use the following command:
4151
```
@@ -50,25 +60,45 @@ $ ./scan2pdf.sh -a -o document_%05d.pdf
5060
See [this section](#command-line-options) for a detailed list of command line
5161
options.
5262

63+
5364
## Contributing
5465

55-
To date, _Scan to PDF (scan2pdf)_ has only been tested with _Brother_ printers.
66+
_Scan to PDF (scan2pdf)_ has mainly been tested with _Brother_ printers.
5667
If you own a printer manufactured by _HP_, _Canon_, _Epson_ or some other
5768
well-established brand and would like to help with adding support, please
5869
create an [issue on GitHub](https://github.com/fonic/scan2pdf/issues) and
5970
provide the output of `scanimage --help`.
6071

72+
73+
## Service Menu
74+
75+
To use the _Service Menu_, which provides a _Scan to PDF_ entry in the
76+
right-click context menu of [KDE](https://kde.org/) file managers
77+
[Konqueror](https://apps.kde.org/konqueror/) and
78+
[Dolphin](https://apps.kde.org/dolphin/), simply copy/move `scan2pdf.desktop`
79+
to `~/.local/share/kio/servicemenus` and make sure `scan2pdf.sh` is stored in
80+
a location accessible via `PATH`.
81+
82+
Advanced users might want to edit and customize `scan2pdf.desktop` (which is
83+
an INI-style text file) to their liking (e.g. to change scan sources, color
84+
modes, scan resolutions, path to `scan2pdf.sh`, etc.).
85+
86+
Screenshot:
87+
88+
![Screenshot](https://raw.githubusercontent.com/fonic/scan2pdf/main/SERVICEMENU.png)
89+
90+
6191
## Command Line Options
6292

6393
Available command line options:
6494
```
6595
Usage: scan2pdf.sh [OPTIONS] OUTFILE
6696
67-
Scan to PDF (scan2pdf) v2.4 (01/15/24)
97+
Scan to PDF (scan2pdf) v2.5 (01/23/24)
6898
Scan documents directly to PDF files.
6999
70100
Options:
71-
-d, --device STRING Scanner device ['brother4:net1;dev0']
101+
-d, --device STRING Scanner device ['brother3:net1;dev0']
72102
-m, --mode STRING Color mode ['24bit Color']
73103
'Black & White',
74104
'Gray[Error Diffusion]',
@@ -91,8 +121,12 @@ Options:
91121
92122
-l, --topleftx VALUE Top left x offset of scan area in mm (0..216) [0]
93123
-t, --toplefty VALUE Top left y offset of scan area in mm (0..356) [0]
94-
-x, --width VALUE Width of scan area in mm (0..216) [216]
95-
-y, --height VALUE Height of scan area in mm (0..356) [279]
124+
-x, --width VALUE Width of scan area in mm (0..216) [210]
125+
-y, --height VALUE Height of scan area in mm (0..356) [297]
126+
127+
-u, --manual-duplex Perform manual duplex scan: scan odd pages, prompt,
128+
scan even pages, then interleave odd and even pages
129+
to produce combined output
96130
97131
-a, --batch-scan Scan multiple documents, prompt in between documents
98132
(option '-o/--outfile-template' becomes mandatory)
@@ -101,12 +135,14 @@ Options:
101135
integer component (e.g. '~/Documents/Scan_%05d.pdf')
102136
103137
-k, --keep-temp Keep temporary directory on exit
138+
104139
-h, --help Print usage information
105140
106141
NOTE:
107142
Strings/values in square brackets show current defaults.
108143
```
109144

145+
110146
## Configuration Options
111147

112148
Configuration options and current defaults:
@@ -118,7 +154,7 @@ Configuration options and current defaults:
118154
# Scan to PDF (scan2pdf) -
119155
# -
120156
# Created by Fonic <https://github.com/fonic> -
121-
# Date: 04/17/21 - 01/15/24 -
157+
# Date: 04/17/21 - 01/23/24 -
122158
# -
123159
# ------------------------------------------------------------------------------
124160

@@ -215,4 +251,4 @@ TIFF2PDF_OPTS=("-j" "-q" "95") # Use JPEG compressi
215251

216252
##
217253

218-
_Last updated: 01/15/24_
254+
_Last updated: 01/23/24_

SERVICEMENU.png

99 KB
Loading

scan2pdf.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# Scan to PDF (scan2pdf) -
66
# -
77
# Created by Fonic <https://github.com/fonic> -
8-
# Date: 04/17/21 - 01/15/24 -
8+
# Date: 04/17/21 - 01/23/24 -
99
# -
1010
# ------------------------------------------------------------------------------
1111

scan2pdf.desktop

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# ------------------------------------------------------------------------------
2+
# -
3+
# Scan to PDF (scan2pdf) - Service Menu for KDE -
4+
# -
5+
# Created by Fonic <https://github.com/fonic> -
6+
# Date: 01/12/24 - 01/23/24 -
7+
# -
8+
# NOTE: -
9+
# Copy/move this file to '~/.local/share/kio/servicemenus' and make -
10+
# sure 'scan2pdf.sh' is stored in a location accessible via PATH. -
11+
# -
12+
# ------------------------------------------------------------------------------
13+
14+
[Desktop Entry]
15+
Type=Service
16+
ServiceTypes=KonqPopupMenu/Plugin
17+
MimeType=inode/directory
18+
Actions=scanToPDF1;scanToPDF2;scanToPDF3;scanToPDF4;scanToPDF5;scanToPDF6;scanToPDF7;scanToPDF8
19+
X-KDE-Priority=TopLevel
20+
X-KDE-Submenu=Scan to PDF
21+
X-KDE-Icon=document-scan
22+
23+
24+
[Desktop Action scanToPDF1]
25+
Name=Color 150 dpi
26+
Icon=color
27+
Exec=scan2pdf.sh -m "24bit Color" -r 150 -o "%f/scan_%05d.pdf"
28+
29+
[Desktop Action scanToPDF2]
30+
Name=Color 200 dpi
31+
Icon=color
32+
Exec=scan2pdf.sh -m "24bit Color" -r 200 -o "%f/scan_%05d.pdf"
33+
34+
[Desktop Action scanToPDF3]
35+
Name=Color 300 dpi
36+
Icon=color
37+
Exec=scan2pdf.sh -m "24bit Color" -r 300 -o "%f/scan_%05d.pdf"
38+
39+
[Desktop Action scanToPDF4]
40+
Name=Color 600 dpi
41+
Icon=color
42+
Exec=scan2pdf.sh -m "24bit Color" -r 600 -o "%f/scan_%05d.pdf"
43+
44+
45+
[Desktop Action scanToPDF5]
46+
Name=Grayscale 150 dpi
47+
Icon=gray-scale
48+
Exec=scan2pdf.sh -m "True Gray" -r 150 -o "%f/scan_%05d.pdf"
49+
50+
[Desktop Action scanToPDF6]
51+
Name=Grayscale 200 dpi
52+
Icon=gray-scale
53+
Exec=scan2pdf.sh -m "True Gray" -r 200 -o "%f/scan_%05d.pdf"
54+
55+
[Desktop Action scanToPDF7]
56+
Name=Grayscale 300 dpi
57+
Icon=gray-scale
58+
Exec=scan2pdf.sh -m "True Gray" -r 300 -o "%f/scan_%05d.pdf"
59+
60+
[Desktop Action scanToPDF8]
61+
Name=Grayscale 600 dpi
62+
Icon=gray-scale
63+
Exec=scan2pdf.sh -m "True Gray" -r 600 -o "%f/scan_%05d.pdf"

0 commit comments

Comments
 (0)