3
Rotate PDF (sh.itjust.works)

Requirements: pdfjam. Looks like some major projects depend on this? I never knew this was installed on my laptop.

Code:

pdfjam --outfile "$@" --angle 270 --fitpaper true --rotateoversize true "$@" # Clockwise
pdfjam --outfile "$@" --angle 90 --fitpaper true --rotateoversize true "$@" # Anti-clockwise

Note: For some reason, rotating the document and reverting it (or doing it 4 times) gets you a different hash.

Bonus: Add this to Yazi config for this:

Rotate options in Yazi

[[open.rules]]
url = "*.pdf"
use = ["pdf"]

# ...

[[opener.pdf]]
desc = "Rotate Clockwise"
orphan = true
run = "pdfjam --outfile \"$@\" --angle 270 --fitpaper true --rotateoversize true \"$@\""

[[opener.pdf]]
desc = "Rotate Anticlockwise"
orphan = true
run = "pdfjam --outfile \"$@\" --angle 90 --fitpaper true --rotateoversize true \"$@\""

no comments (yet)
sorted by: hot top new old
there doesn't seem to be anything here
this post was submitted on 27 Jan 2026
3 points (80.0% liked)

BASHing

51 readers
1 users here now

Share your bash scripts here!

founded 10 months ago
MODERATORS