replace pdftk with qpdf
This commit is contained in:
parent
86fa98dfc7
commit
297af9a74a
@ -13,7 +13,7 @@ picture per page.
|
|||||||
This utility requires the following tools to be installed:
|
This utility requires the following tools to be installed:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
apt install imagemagick pdfjam pdftk
|
apt install imagemagick pdfjam qpdf
|
||||||
```
|
```
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
16
photos2pdf
16
photos2pdf
@ -407,7 +407,8 @@ for png in "$outdir/"*.png ; do
|
|||||||
warning "Could not convert \"$png\" to PDF; skipped."
|
warning "Could not convert \"$png\" to PDF; skipped."
|
||||||
rv=1
|
rv=1
|
||||||
continue
|
continue
|
||||||
elif ! pdfjam \
|
elif ! \
|
||||||
|
pdfjam \
|
||||||
--quiet \
|
--quiet \
|
||||||
--outfile "$tmpdir" \
|
--outfile "$tmpdir" \
|
||||||
--paper "$paper" \
|
--paper "$paper" \
|
||||||
@ -419,10 +420,10 @@ for png in "$outdir/"*.png ; do
|
|||||||
warning "Could not align \"$pdf\"; skipped."
|
warning "Could not align \"$pdf\"; skipped."
|
||||||
rv=1
|
rv=1
|
||||||
continue
|
continue
|
||||||
elif ! pdftk \
|
elif ! qpdf \
|
||||||
"$jammed" \
|
"$jammed" \
|
||||||
stamp "$backdrop" \
|
--overlay "$backdrop" \
|
||||||
output "$backdropped"
|
-- "$backdropped"
|
||||||
then
|
then
|
||||||
warning "Could not watermark \"$pdf\"; skipped."
|
warning "Could not watermark \"$pdf\"; skipped."
|
||||||
rv=1
|
rv=1
|
||||||
@ -436,7 +437,12 @@ while read -r pdf ; do
|
|||||||
input+=("$pdf")
|
input+=("$pdf")
|
||||||
done < <(ls -- "$tmpdir/"*.backdropped.pdf)
|
done < <(ls -- "$tmpdir/"*.backdropped.pdf)
|
||||||
|
|
||||||
if ! pdftk "${input[@]}" cat output "$pdfdir/$result_filename" ; then
|
if ! \
|
||||||
|
qpdf \
|
||||||
|
--empty \
|
||||||
|
--pages "${input[@]}" \
|
||||||
|
-- "$pdfdir/$result_filename"
|
||||||
|
then
|
||||||
warning "Could not concatenate \"$result_filename\"."
|
warning "Could not concatenate \"$result_filename\"."
|
||||||
rv=1
|
rv=1
|
||||||
elif ! "$keep_tmpfiles" ; then
|
elif ! "$keep_tmpfiles" ; then
|
||||||
|
Loading…
Reference in New Issue
Block a user