Skip to content

Instantly share code, notes, and snippets.

@NukeManDan
Created April 6, 2023 23:04
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save NukeManDan/120afeb804745acf8e144d143340ac2a to your computer and use it in GitHub Desktop.
Save NukeManDan/120afeb804745acf8e144d143340ac2a to your computer and use it in GitHub Desktop.
How to take a load of huge photos and make a tiny PDF for invoicing via a could CLI commands

PDF invocing with a ton of photos

For invoice reimbursements, use imagemagick CLI tools to help us make invoice PDF compliance easy!

# Use whatever package manager you need, likely:
sudo apt install imagemagick

Most phones are way to big Mpeg wise... we want to send pics low quality but legible:

# Irreversably overwite in place (suggested)
for i in *.jpg; do convert $i -quality 20% $i; done;

# OR make new files in place(meh)
for i in *.jpg; do convert $i -quality 20% smol-$i; done;

Assuming:

  • You have a folder that includes only the photos you want in a single PDF
  • Photos are in an order that numerically makes sense (if you need it in accounting to match). Most pics now have a timestamp as a file name that makes this linear in time of capture by default.
convert *.jpg SOMETHING-receipt-photos.pdf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment