replace pdftk with qpdf

This commit is contained in:
Tilman Kranz 2024-03-24 01:27:15 +01:00
parent 86fa98dfc7
commit 297af9a74a
2 changed files with 19 additions and 13 deletions

View File

@ -13,7 +13,7 @@ picture per page.
This utility requires the following tools to be installed:
```shell
apt install imagemagick pdfjam pdftk
apt install imagemagick pdfjam qpdf
```
## Installation

View File

@ -407,7 +407,8 @@ for png in "$outdir/"*.png ; do
warning "Could not convert \"$png\" to PDF; skipped."
rv=1
continue
elif ! pdfjam \
elif ! \
pdfjam \
--quiet \
--outfile "$tmpdir" \
--paper "$paper" \
@ -419,10 +420,10 @@ for png in "$outdir/"*.png ; do
warning "Could not align \"$pdf\"; skipped."
rv=1
continue
elif ! pdftk \
elif ! qpdf \
"$jammed" \
stamp "$backdrop" \
output "$backdropped"
--overlay "$backdrop" \
-- "$backdropped"
then
warning "Could not watermark \"$pdf\"; skipped."
rv=1
@ -436,7 +437,12 @@ while read -r pdf ; do
input+=("$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\"."
rv=1
elif ! "$keep_tmpfiles" ; then