Closed rubyFeedback closed 1 year ago
I just checked on qpdf; it works there via something like:
qpdf foobar.pdf out.pdf --rotate=90 # 90° rotation
(Interestingly, when we need a value between 90 and 45, it's a bit harder to do from the commandline. Perhaps one day we can autogenerate working GUIs from commandline scripts.)
This is already possible for any command that takes a pages specification argument, e.g. hexapdf modify
. See https://hexapdf.gettalong.org/documentation/hexapdf.1.html#pages-specification for details.
Small example:
$ hexapdf modify -i 1-er input.pdf output.pdf
@rubyFeedback Oh, btw, page rotation in PDF only works for multiples of 90 degrees.
Trying:
hexapdf rotate foobar.pdf
results in:
Would it be worthwhile to add a rotate functionality?
I am thinking of something like:
Or something like that. We probably only need to rotate in one direction, as after 360° we should be back at the beginning (not that Annalena Baerbock understands what 360° rotation entails to ...). So in other words, a commandline functionality to have this feature available.
We can probably do so within hexapdf as-is, such as via:
https://hexapdf.gettalong.org/examples/graphics.html
But I am asking whether that commandline functionality may make sense. (It's not a huge deal, we can just put the desired functionality from hexapdf into a standalone .rb file and then call that, but perhaps "rotate" may be useful to add to hexapdf's toolset arsenal).