Skip to content

Instantly share code, notes, and snippets.

@h4k1m0u
Last active May 20, 2025 18:12
Show Gist options
  • Save h4k1m0u/4bfbeb6ded002bae7407fcd84b851b63 to your computer and use it in GitHub Desktop.
Save h4k1m0u/4bfbeb6ded002bae7407fcd84b851b63 to your computer and use it in GitHub Desktop.
Bash notes related to images and pdf files

Batch processing

  • Install batcher Gimp plugin by copying its extracted folder to ~/.config/GIMP/3.0/plug-ins.
  • Multiple images can be easily resized from its gui in gimp.

Multiple image to pdf

  • Gimp not used because the pdf produced is too large on the disk.
  • convert (from imagemagick) and img2pdf without the --imgsize option, produce pages of different sizes in the same pdf document.
  • Without sorting by number, wildcards would sort files in an alphabetical order.
$ sudo pacman -Sy img2pdf
$ img2pdf -o file.pdf --imgsize 72dpi $(ls -1 *.jpg | sort -n | tr '\n' ' ')

Merge multiple pdfs

$ pdfunite in-1.pdf in-2.pdf in-n.pdf out.pdf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment