How to extract image rotation from a PDF

1

I'm extracting all the images from a bunch of scanned PDFs using pdfimages, in order to process and repackage them.

The problem is that some images are rotated 90° (either CW or CCW) and others are not. The original PDF re-rotates them on the page, so that all the pages show up straight, but the extracted images remain rotated.

I couldn't find an option in pdfimages to output the rotations, so that I could use them in a script.

Is there a way to extract this information?

Tobia

Posted 2015-12-18T12:03:53.770

Reputation: 330

Answers

-1

I'm not sure if your PDF's are multi-page, so if they are then use pdfTK or pdfSAM to break them into single page PDF's, then use The Gimp to rotate the images manually.

The other thing that you could is use a tool like ImageMagick to automate the rotation, but you would probably have to separate the normal, CW, CCW pictures into different folders.

David

Posted 2015-12-18T12:03:53.770

Reputation: 2 222

The actual problem is automatic recognition of the rotation, not how to rotate pages/images manually. – Thomas W. – 2016-11-25T22:47:06.997