Skip to content

Commit d66e5f9

Browse files
author
Fonic
committed
Release scan2pdf-v2.4
Changes: - Changed workflow to either use 'scanimage'+'convert' (preferred) -or- 'scanimage'+'tiffcp'+'tiff2pdf' (fallback); 'convert' is preferred as 'tiff2pdf' might get removed from LibTIFF in the future (see https:// bugs.gentoo.org/914232) - Updated dependency requirements in 'README.md' to reflect new workflow (now, either ImageMagick -or- LibTIFF is required) - Added output options for 'convert' equivalent to those currently used for 'tiff2pdf' (i.e. ZIP compression -or- JPEG compression, quality 95) - Added command options to 'Scan settings/parameters' listing printed to console
1 parent 4123c2e commit d66e5f9

4 files changed

Lines changed: 165 additions & 114 deletions

File tree

CHANGELOG.md

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
## Changelog for release v2.4
2+
3+
**Changes:**
4+
- Changed workflow to either use `scanimage`+`convert` (preferred) -or-
5+
`scanimage`+`tiffcp`+`tiff2pdf` (fallback); `convert` is preferred as
6+
`tiff2pdf` might get removed from _LibTIFF_ in the future (see https://
7+
bugs.gentoo.org/914232)
8+
- Updated dependency requirements in `README.md` to reflect new workflow
9+
(now, either _ImageMagick_ -or- _LibTIFF_ is required)
10+
- Added output options for `convert` equivalent to those currently used for
11+
`tiff2pdf` (i.e. ZIP compression -or- JPEG compression, quality 95)
12+
- Added command options to `Scan settings/parameters` listing printed to
13+
console
14+
115
## Changelog for release v2.3
216

317
**Changes:**
@@ -24,11 +38,13 @@
2438

2539
## Changelog for release v2.2
2640

41+
Release has not been published (skipped ahead to release v2.3).
42+
2743
**Changes:**
28-
- Added support for using `convert` (ImageMagick) instead of `tiff2pdf`
29-
(LibTIFF) as the latter is no longer being built by default and will
30-
probably be removed completely from from LibTIFF in the foreseable future
31-
(see https://bugs.gentoo.org/914232)
44+
- Added support for using `convert` (part of ImageMagick) instead of
45+
`tiff2pdf` (part of LibTIFF) as the latter is no longer being built by
46+
default and will probably be removed completely from from LibTIFF in the
47+
foreseeable future (see https://bugs.gentoo.org/914232)
3248
- Added empty lines within usage information group similar items (e.g.
3349
brightness + contrast, topleftx + toplefty + width + height, etc.)
3450
- If an output file is specified, abort if it already exists (instead of
@@ -51,4 +67,4 @@ Initial release (versions prior to v2.1 have not been published).
5167

5268
##
5369

54-
_Last updated: 01/14/24_
70+
_Last updated: 01/15/24_

README.md

Lines changed: 44 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,17 @@ help me achieve that goal and are highly appreciated.
1313

1414
## Requirements
1515
**Dependencies:**<br/>
16-
_Bash (>=v4.0)_,
17-
_scanimage_ (part of [SANE](http://www.sane-project.org/)),
18-
_tiffcp_ (part of [LibTIFF](http://libtiff.maptools.org/)),
19-
_tiff2pdf_ (part of [LibTIFF](http://libtiff.maptools.org/))
16+
_Bash_ (&ge;v4.0),
17+
_scanimage_ (part of [SANE](http://www.sane-project.org/)),
18+
_convert_ (part of [ImageMagick](https://www.imagemagick.org/))
2019
-or-
21-
_convert_ (part of [ImageMagick](https://www.imagemagick.org/))
20+
_tiffcp_/_tiff2pdf_ (part of [LibTIFF](http://libtiff.maptools.org/))
2221

2322
**Packages:**<br/>
24-
Ubuntu: _bash_, _sane-utils_, _libtiff-tools_, _imagemagick_<br/>
25-
Gentoo: _app-shells/bash_, _media-gfx/sane-backends_, _media-libs/tiff_,
26-
_media-gfx/imagemagick_
23+
Ubuntu: _bash_, _sane-utils_, _imagemagick_ -or- _libtiff-tools_<br/>
24+
Gentoo: _app-shells/bash_, _media-gfx/sane-backends_, _media-gfx/imagemagick_
25+
-or- _media-libs/tiff_
26+
2727

2828
## Download & Installation
2929
Refer to the [releases](https://github.com/fonic/scan2pdf/releases) section
@@ -33,8 +33,8 @@ the downloaded archive to a folder of your choice.
3333
## Configuration
3434
Open `scan2pdf.conf` in your favorite text editor and adjust the settings
3535
to your liking. Refer to embedded comments for details. Refer to
36-
[this section](#configuration-options) for a listing of all configuration
37-
options and current defaults.
36+
[this section](#configuration-options) for a listing of configuration options
37+
and current defaults.
3838

3939
## Quick Start
4040
To scan a single document to PDF file, use the following command:
@@ -47,14 +47,25 @@ To scan multiple documents to PDF files, use the following command:
4747
$ ./scan2pdf.sh -a -o document_%05d.pdf
4848
```
4949

50+
See [this section](#command-line-options) for a detailed list of command line
51+
options.
52+
53+
## Contributing
54+
55+
To date, _Scan to PDF (scan2pdf)_ has only been tested with _Brother_ printers.
56+
If you own a printer manufactured by _HP_, _Canon_, _Epson_ or some other
57+
well-established brand and would like to help with adding support, please
58+
create an [issue on GitHub](https://github.com/fonic/scan2pdf/issues) and
59+
provide the output of `scanimage --help`.
60+
5061
## Command Line Options
5162

5263
Available command line options:
5364
```
5465
Usage: scan2pdf.sh [OPTIONS] OUTFILE
5566
56-
Scan to PDF (scan2pdf) v2.3 (01/14/24)
57-
Scan documents directly to PDF file.
67+
Scan to PDF (scan2pdf) v2.4 (01/15/24)
68+
Scan documents directly to PDF files.
5869
5970
Options:
6071
-d, --device STRING Scanner device ['brother4:net1;dev0']
@@ -107,7 +118,7 @@ Configuration options and current defaults:
107118
# Scan to PDF (scan2pdf) -
108119
# -
109120
# Created by Fonic <https://github.com/fonic> -
110-
# Date: 04/17/21 - 01/14/24 -
121+
# Date: 04/17/21 - 01/15/24 -
111122
# -
112123
# ------------------------------------------------------------------------------
113124

@@ -175,32 +186,33 @@ WIDTH_MIN=0
175186
WIDTH_MAX=216
176187
HEIGHT_MIN=0
177188
HEIGHT_MAX=356
178-
#WIDTH_DEFAULT=210 # DIN A4 (210.0 mm / 8.3 in)
179-
#HEIGHT_DEFAULT=297 # DIN A4 (297.0 mm / 11.7 in)
180-
#WIDTH_DEFAULT=216 # Legal (215.9 mm / 8.5 in)
181-
#HEIGHT_DEFAULT=356 # Legal (355.6 mm / 14.0 in)
182-
WIDTH_DEFAULT=216 # Letter (215.9 mm / 8.5 in)
183-
HEIGHT_DEFAULT=279 # Letter (279.4 mm / 11.0 in)
189+
#WIDTH_DEFAULT=210 # DIN A4 (210.0 mm / 8.3 in)
190+
#HEIGHT_DEFAULT=297 # DIN A4 (297.0 mm / 11.7 in)
191+
#WIDTH_DEFAULT=216 # Legal (215.9 mm / 8.5 in)
192+
#HEIGHT_DEFAULT=356 # Legal (355.6 mm / 14.0 in)
193+
WIDTH_DEFAULT=216 # Letter (215.9 mm / 8.5 in)
194+
HEIGHT_DEFAULT=279 # Letter (279.4 mm / 11.0 in)
184195

185196
# Options passed to 'scanimage' (array of strings)
186-
#SCANIMAGE_OPTS=("--progress" "--verbose") # display scan progress, use verbose output
187-
SCANIMAGE_OPTS=("--progress") # display scan progress
197+
#SCANIMAGE_OPTS=("--progress" "--verbose") # Display scan progress, produce verbose output
198+
SCANIMAGE_OPTS=("--progress") # Display scan progress
199+
200+
# Options passed to 'convert' (array of strings)
201+
# NOTE: uses separate options for INPUT and OUTPUT
202+
CONVERT_INPUT_OPTS=() # No input options
203+
#CONVERT_OUTPUT_OPTS=("-compress" "zip") # Use ZIP compression (lossless, higher quality, larger PDF file)
204+
CONVERT_OUTPUT_OPTS=("-compress" "jpeg" "-quality" "95") # Use JPEG compression (quality 95) (lossy, lower quality, smaller PDF file)
188205

189206
# Options passed to 'tiffcp' (array of strings)
190-
TIFFCP_OPTS=("-c" "lzw") # use LZW compression (fast)
207+
# NOTE: only used if 'convert' is not available
208+
TIFFCP_OPTS=("-c" "lzw") # Use LZW compression (fast, lossless)
191209

192210
# Options passed to 'tiff2pdf' (array of strings)
193-
#TIFF2PDF_OPTS=("-z") # use ZIP compression (lossless, higher quality, bigger PDF file)
194-
TIFF2PDF_OPTS=("-j" "-q" "95") # use JPEG compression (quality 95) (lossy, lower quality, smaller PDF file)
195-
196-
# Options passed to 'convert' (array of strings)
197-
# NOTE:
198-
# 'convert' is only used if 'tiff2pdf' is not available
199-
# 'convert' uses separate options for INPUT and OUTPUT
200-
CONVERT_INPUT_OPTS=() # none
201-
CONVERT_OUTPUT_OPTS=() # none
211+
# NOTE: only used if 'convert' is not available
212+
#TIFF2PDF_OPTS=("-z") # Use ZIP compression (lossless, higher quality, larger PDF file)
213+
TIFF2PDF_OPTS=("-j" "-q" "95") # Use JPEG compression (quality 95) (lossy, lower quality, smaller PDF file)
202214
```
203215

204216
##
205217

206-
_Last updated: 01/14/24_
218+
_Last updated: 01/15/24_

scan2pdf.conf

Lines changed: 20 additions & 19 deletions
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/14/24 -
8+
# Date: 04/17/21 - 01/15/24 -
99
# -
1010
# ------------------------------------------------------------------------------
1111

@@ -73,27 +73,28 @@ WIDTH_MIN=0
7373
WIDTH_MAX=216
7474
HEIGHT_MIN=0
7575
HEIGHT_MAX=356
76-
#WIDTH_DEFAULT=210 # DIN A4 (210.0 mm / 8.3 in)
77-
#HEIGHT_DEFAULT=297 # DIN A4 (297.0 mm / 11.7 in)
78-
#WIDTH_DEFAULT=216 # Legal (215.9 mm / 8.5 in)
79-
#HEIGHT_DEFAULT=356 # Legal (355.6 mm / 14.0 in)
80-
WIDTH_DEFAULT=216 # Letter (215.9 mm / 8.5 in)
81-
HEIGHT_DEFAULT=279 # Letter (279.4 mm / 11.0 in)
76+
#WIDTH_DEFAULT=210 # DIN A4 (210.0 mm / 8.3 in)
77+
#HEIGHT_DEFAULT=297 # DIN A4 (297.0 mm / 11.7 in)
78+
#WIDTH_DEFAULT=216 # Legal (215.9 mm / 8.5 in)
79+
#HEIGHT_DEFAULT=356 # Legal (355.6 mm / 14.0 in)
80+
WIDTH_DEFAULT=216 # Letter (215.9 mm / 8.5 in)
81+
HEIGHT_DEFAULT=279 # Letter (279.4 mm / 11.0 in)
8282

8383
# Options passed to 'scanimage' (array of strings)
84-
#SCANIMAGE_OPTS=("--progress" "--verbose") # display scan progress, use verbose output
85-
SCANIMAGE_OPTS=("--progress") # display scan progress
84+
#SCANIMAGE_OPTS=("--progress" "--verbose") # Display scan progress, produce verbose output
85+
SCANIMAGE_OPTS=("--progress") # Display scan progress
86+
87+
# Options passed to 'convert' (array of strings)
88+
# NOTE: uses separate options for INPUT and OUTPUT
89+
CONVERT_INPUT_OPTS=() # No input options
90+
#CONVERT_OUTPUT_OPTS=("-compress" "zip") # Use ZIP compression (lossless, higher quality, larger PDF file)
91+
CONVERT_OUTPUT_OPTS=("-compress" "jpeg" "-quality" "95") # Use JPEG compression (quality 95) (lossy, lower quality, smaller PDF file)
8692

8793
# Options passed to 'tiffcp' (array of strings)
88-
TIFFCP_OPTS=("-c" "lzw") # use LZW compression (fast)
94+
# NOTE: only used if 'convert' is not available
95+
TIFFCP_OPTS=("-c" "lzw") # Use LZW compression (fast, lossless)
8996

9097
# Options passed to 'tiff2pdf' (array of strings)
91-
#TIFF2PDF_OPTS=("-z") # use ZIP compression (lossless, higher quality, bigger PDF file)
92-
TIFF2PDF_OPTS=("-j" "-q" "95") # use JPEG compression (quality 95) (lossy, lower quality, smaller PDF file)
93-
94-
# Options passed to 'convert' (array of strings)
95-
# NOTE:
96-
# 'convert' is only used if 'tiff2pdf' is not available
97-
# 'convert' uses separate options for INPUT and OUTPUT
98-
CONVERT_INPUT_OPTS=() # none
99-
CONVERT_OUTPUT_OPTS=() # none
98+
# NOTE: only used if 'convert' is not available
99+
#TIFF2PDF_OPTS=("-z") # Use ZIP compression (lossless, higher quality, larger PDF file)
100+
TIFF2PDF_OPTS=("-j" "-q" "95") # Use JPEG compression (quality 95) (lossy, lower quality, smaller PDF file)

0 commit comments

Comments
 (0)