[enhancement] Make scaling work with mixed-orientation documents
Scaling is really helpful when using pdftoppm in a printing pipeline, the problem is that landscape pages end up not being usable. They either get squashed or remain landscape....
There is no rotate-to-fit logic, so you end up with squashed pages if they are truly encoded in portrait, or they remain landscape if they are rotated by attributes in the PDF. If you set -scale-dimension-before-rotation
, all landscape-looking pages end up squashed.
Would it be possible to add an option to rotate with +/- 90 degrees (in addition to any pre-existing rotation attribute) conditionally on the page aspect ratio?
Here is a good test PDF, which both has a true landscape page, and a rotated one. https://wiki.debian.org/CUPSPdfToPdf?action=AttachFile&do=view&target=mixed.pdf